Skip to main content
With the Global-e solution installed, your store has now two types of checkouts, the standard checkout for your local customers and the Global-e checkout for your international customers.
This document provides you, the merchant, with the basic instructions required to implement tracking events on your website. MEASURING PLATFORM EVENTS To measure marketing platform events on the Global-e checkout, you must add the pixels or tags of the relevant marketing platforms to the pages containing Global-e checkout, as described in this document RELATED DOCUMENTATION For detailed technical documentation, see Global‑e Order Transaction Support for Analytics
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:
  1. Edit the OnCheckoutStepLoaded callback function by adding the relevant pixel snippets to the callback function.1. Edit the OnCheckoutStepLoaded Callback Function
  2. Place the final OnCheckoutStepLoaded callback function on your site.2. Place the Final OnCheckoutStepLoad Callback on your Site
  3. Edit the OnCheckoutStepLoaded Callback Function The following code snippet presents the subscription to the OnCheckoutStepLoaded callback 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.
    PlatformEventExample
    Google Tag Manager (Data Layer)Purchase EventGoogle Tag Manager (Purchase Data Layer)
    Google Ads (gtag)Conversion Eventgtag - Conversion Event
    TikTokPlaceAnOrder EventTikTok - PlaceAnOrDer Event
  4. Place the Final OnCheckoutStepLoad Callback on your Site To implement the final OnCheckoutStepLoad callback on your site: OnCheckoutStepLoadedonline store, in the head element. 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:
Variable DefinitionVariable JSON Path
Global‑e Order Iddata.details.OrderID
The merchant currency: The Store currencydata.details.MerchantCurrencyCode
Order products total (in merchant currency)data.details.OrderPrices.MerchantTransaction.TotalProductsPrice
Single product sale price (in base Store currency)data.details.ProductInformation[i].ProductPrices.MerchantTransaction.SalePrice
Single product quantitydata.details.ProductInformation[i].Quantity
Single product SKUdata.details.ProductInformation[i].SKU
See Global‑e Order Transaction Support for Analytics for the complete list of variables.
Google Tag Manager (Purchase Data Layer)
gtag - Conversion Event
TikTok - PlaceAnOrDer Event
Data Object Confirmation Step (JSON)
The following example illustrates the data object confirmation step in JSON format.
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 can retrieve the converted prices.