
Adding Pixels to the Global‑e Checkout
Global‑e provides a JavaScript callback function (“OnCheckoutStepLoaded”) that holds the checkout and order information in a data object. You can use this callback to trigger events both when the Global‑e checkout is loaded or complete.
To embed pixels in the Global-e checkout:
- Edit the OnCheckoutStepLoaded callback function by adding the relevant pixel snippets to the callback function.1. Edit the OnCheckoutStepLoaded Callback Function
- Place the final OnCheckoutStepLoaded callback function on your site.2. Place the Final OnCheckoutStepLoad Callback on your Site
-
Edit the
OnCheckoutStepLoadedCallback Function The following code snippet presents the subscription to theOnCheckoutStepLoadedcallback function. Note that this code currently does not contain any pixels. data.Steps.LOADED****loaded, while the data.Steps.CONFIRMATION case is executed when the Global‑e checkout has been completed.We recommend deferring the Global-e scripts until after the entire document has been parsed. Hopefully, this will allow any analytics code to load onto the page before the Global-e analytics scripts load. If the above recommendations do not improve the situation, we recommend you add your analytics code to the source of the checkout page, assuming there are no reasons preventing that from happening. Converted price analytics You may need to capture converted prices in analytics that run on your product page and other pages before checkout. To do this, there is an event that triggers after the prices on the page are converted. You can subscribe to this event, and after it triggers, you can execute your analytics, so you are able to retrieve the converted prices.As mentioned, the callback returns a data object in JSON format that contains information about the checkout, such as item prices and quantities, order total, and currency. Use the variables in the JSON data object to configure your pixel. See Data Object Confirmation Step (JSON) for an example. Use the relevant data object variables to add pixels to the LOADED step, the CONFIRMATION step, or both. The following examples show how this is edited or amended for each marketing platform. -
Place the Final OnCheckoutStepLoad Callback on your Site
To implement the final OnCheckoutStepLoad callback on your site:
OnCheckoutStepLoadedonline store, in theheadelement. Note that the callback function is only initiated when the Global‑e checkout is loaded or complete, even though the function is implemented on every page of your site.
Common Data Object Variables
The following table lists the most common data object variables used in marketing platforms events:
See Global‑e Order Transaction Support for Analytics for the complete list of variables.

