> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mention-me.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Integrate Mention Me Tags into Global-e Checkout

> How to add Mention Me referrer and referee tags into Global-e checkouts, including Shopify + Global-e setups.

## How Does Global-e Integrate with Websites?

Using Global-e as your checkout provider means your brand hosts specific pages (such as checkout or order confirmation) that contain a Global-e iframe. You cannot 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**.

## Implementing the Referrer Tag

This tag collects customer information and serves referral offers post-purchase.

<Steps>
  <Step title="Add the Tag">
    Paste the following script on the page containing your Global-e iframe:

    ```html theme={null}
    <script type="text/javascript">
    var glegem = glegem || function() { (window["glegem"].q = window["glegem"].q || []).push(arguments); };

    glegem("OnCheckoutStepLoaded", checkoutHandlerMentionMe);

    function checkoutHandlerMentionMe(data) {
      if (data.StepId === "undefined" || data.StepId !== data.Steps.CONFIRMATION) return;
      if (data.IsSuccess !== true || data.IsPageReload === true) return;

      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);
    }
    </script>
    ```
  </Step>

  <Step title="Add Partner Code and Locale">
    * Replace `<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](/knowledge/tags/locales-languages-currencies).
  </Step>

  <Step title="Update Demo to Live URL">
    * Use `tag-demo.mention-me.com` when testing.
    * Switch to `tag.mention-me.com` for live use.

    The live tag URL is disabled by default. Activate it via your Client Manager before customer-facing use. You can preview functionality using the Debug Tool.
  </Step>
</Steps>

## Additional Help

Required Mention Me variables: <a href="https://demo.mention-me.com/api-demo/v2/generic/instructions/referrer/postpurchase/popup" target="_blank" rel="noopener noreferrer">Integration instructions</a>

Global-e variables: <a href="https://web.global-e.com/merchant/clientapi#ganaadd" target="_blank" rel="noopener noreferrer">Full Global-e variable list</a>

### 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:

```javascript theme={null}
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);
```

Ensure you:

* Only run the tag when `data.StepId == data.Steps.CONFIRMATION` and `data.IsSuccess` is true.
* Include your Partner Code and a valid `locale`.

<Frame caption="The globale-tracking.liquid snippet with the Mention Me referrer tag added.">
  <img src="https://mintcdn.com/mentionme/V2LNKGCh7ROBia07/images/knowledge/tags/360021067537.png?fit=max&auto=format&n=V2LNKGCh7ROBia07&q=85&s=e6c8e9db4bfde3d702d8d4422b3dea5b" alt="Shopify globale-tracking.liquid snippet with Mention Me referrer tag" width="1530" height="1003" data-path="images/knowledge/tags/360021067537.png" />
</Frame>

Include this in **theme.liquid** to load the Global-e script at checkout:

```liquid theme={null}
{% include "globale-tracking.liquid" %}
```

This should go inside the `<head>` tag in your layout.

<Frame caption="The theme.liquid include for the globale-tracking snippet.">
  <img src="https://mintcdn.com/mentionme/V2LNKGCh7ROBia07/images/knowledge/tags/9433911146269.png?fit=max&auto=format&n=V2LNKGCh7ROBia07&q=85&s=830e9d60ea4566ce3f64ccb3519d8147" alt="Shopify theme.liquid include for globale-tracking snippet" width="1133" height="296" data-path="images/knowledge/tags/9433911146269.png" />
</Frame>

### 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.

<a href="https://demo.mention-me.com/api-demo/v2/generic/instructions/referee/checkout/link" target="_blank" rel="noopener noreferrer">Referee tag integration instructions</a>

The referee tag cannot be used within the Global-e checkout environment.
