Skip to main content
This page explains how to add and initialize the Global-e Analytics SDK on your website. Use this guide if you are not already using the Global-e Client SDK in your integration.
This guide is intended only for merchants who are not using the client-side SDK in their Global-e integration. Please note that this is not the standard Global-e integration method.

Overview

The Analytics SDK lets you track browsing activity for shoppers by sending analytics events to Global-e. The SDK must be loaded and initialized on every page where you want to capture events. After initialization, you must immediately send the BrowsingStart event.

Implementation Steps

  1. Add the Analytics SDK script to the <head> section of your site. Use the /PROD/ path for production, and /QA-INT/ or /STG/ for testing or development.
  2. Immediately after the script, add the initialization code, replacing the placeholder values with your own:
    1. merchantId: your unique merchant identifier provided by Global-e.
    2. shopperCountryCode: the two-letter ISO 3166-1 Alpha-2 country code of the shopper, updated dynamically from your country selector.
    3. cdnUrl: the Global-e environment URL. For production use https://webservices.global-e.com/, and for development use connect.bglobale.com (QA-INT) or connect2.bglobale.com (STG).
  3. After initialization, immediately call sendBrowsingStartEvent(). This step is critical for tracking user activity and must be repeated on every page load.

Example Implementation