How does Global-e integrate with websites?
Using Global-e as your checkout provider means your brand hosts specific pages within your website, such as the checkout or order confirmation page.
These pages contain a Global-e iframe, which populates the page with content. You can’t modify this iframe or use unsupported variables, but you can hook into Global-e functionality using their API to integrate Mention Me.
There are two tags to implement: the Referrer tag and the Referee tag. Read on to get started.
Implementing the Referrer Tag
This tag collects customer information and serves referral offers post-purchase.
Step 1: Add the Tag
Paste the following script on the page containing your Global-e iframe:
<script type="text/javascript">
// First, initiate Global-e
var glegem = glegem || function() { (window["glegem"].q = window["glegem"].q || []).push(arguments); };
// Mention Me handler
glegem("OnCheckoutStepLoaded", checkoutHandlerMentionMe);
function checkoutHandlerMentionMe(data) {
// Only run on confirmation step
if (data.StepId === "undefined" || data.StepId !== data.Steps.CONFIRMATION) return;
if (data.IsSuccess !== true || data.IsPageReload === true) return;
// Inject Mention Me tag
var script = document.createElement("script");
var url = "https://tag.mention-me.com/api/v2/referreroffer/<PARTNER-CODE>?locale=<Locale>&situation=postpurchaseglobale";
url += "&email=" + encodeURIComponent(data.details.customerEmail);
url += "&fullname=" + encodeURIComponent(data.details.customerName);
url += "&order_number=" + encodeURIComponent(data.details.OrderReference);
url += "&order_total=" + encodeURIComponent(data.details.totalPriceExclVAT); // Excludes VAT and shipping
url += "&order_currency=" + encodeURIComponent(data.details.customerCurrency);
script.src = url;
document.head.appendChild(script);
}
</script>
Step 2: Add Partner Code and Locale
- Replace the
<PARTNER-CODE>with your Mention Me Partner Code (ask your Client Manager). - Set the
locale:- Hardcode a value (e.g.
en_GB), or - Dynamically set using Global-e’s data layer.
- Learn more about locales.
- Hardcode a value (e.g.
Step 3: Update Demo to Live URL
- Use
tag-demo.mention-me.comwhen testing. - Switch to
tag.mention-me.comfor live use.
The live tag URL is disabled by default. You’ll need to activate it via your Client Manager before customer-facing use. You're also able to preview functionality using the Debug Tool.
Additional Help
Required Mention Me variables: Integration instructions
Global-e variables: Full Global-e variable list
Referrer Tag in Global-e + Shopify
If using Shopify with Global-e, locate your globale-tracking.liquid snippet. It should include the following inside the OnCheckoutStepLoaded callback:
var script = document.createElement("script");
var url = "https://tag.mention-me.com/api/v2/referreroffer/<PARTNER-CODE>?locale=<Locale>&situation=postpurchaseglobale";
url += "&email=" + encodeURIComponent(data.details.customerEmail);
url += "&fullname=" + encodeURIComponent(data.details.customerName);
url += "&order_number=" + encodeURIComponent(data.details.OrderReference);
url += "&order_total=" + encodeURIComponent(data.details.totalPriceExclVAT);
url += "&order_currency=" + encodeURIComponent(data.details.customerCurrency);
script.src = url;
document.head.appendChild(script);
Be sure to:
- Only run the tag when
data.StepId == data.Steps.CONFIRMATIONanddata.IsSuccessis true. - Include your Partner Code and a valid
locale.
Here’s an example with the tag conditionally included:
Don’t forget to include this in the theme.liquid to load the Global-e script at checkout:
{% include "globale-tracking.liquid" %}
This should go inside the <head> tag in your layout:
Implementing the Referee Tag
Add the referee tag outside of the Global-e checkout—such as on the cart or side cart—so users can enter who referred them.
Referee tag integration instructions here.
The referee tag can’t be used within the Global-e checkout environment.