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

# Referrer Tag

> Integrate the referrer tag on your order confirmation page to promote referrals and track conversions

export const SignInNotice = ({message = "To see code snippets pre-filled with your partner code"}) => {
  return <div data-mm-sign-in style={{
    display: "none"
  }}>
      <Info>
        {message}, <a data-mm-sign-in-link href="https://app.mention-me.com/sign-in"><strong>sign in</strong></a>.
      </Info>
    </div>;
};

export const MerchantContext = () => {
  const PARTNER_STORAGE_KEY = "mm-docs-partner";
  const escapeHtml = str => str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
  const getStoredPartner = () => {
    try {
      const raw = localStorage.getItem(PARTNER_STORAGE_KEY);
      if (!raw) return null;
      const data = JSON.parse(raw);
      if (data && data.partnerCode) return data;
    } catch (e) {}
    return null;
  };
  const setStoredPartner = data => {
    try {
      localStorage.setItem(PARTNER_STORAGE_KEY, JSON.stringify(data));
    } catch (e) {}
  };
  const clearStoredPartner = () => {
    try {
      localStorage.removeItem(PARTNER_STORAGE_KEY);
    } catch (e) {}
  };
  const captureQueryParams = () => {
    const params = new URLSearchParams(window.location.search);
    const partner = params.get("partner");
    const name = params.get("name");
    if (partner) {
      const data = {
        partnerCode: partner
      };
      if (name) data.displayName = name;
      setStoredPartner(data);
      params.delete("partner");
      params.delete("name");
      const qs = params.toString();
      const clean = window.location.pathname + (qs ? "?" + qs : "") + window.location.hash;
      window.history.replaceState(null, "", clean);
      return data;
    }
    return getStoredPartner();
  };
  const isLocal = typeof window !== "undefined" && window.location.hostname === "localhost";
  const API_BASE = isLocal ? "http://localhost:3001" : "https://app.mention-me.com";
  const SIGN_IN_BASE = isLocal ? "http://localhost:3001/sign-in" : "https://app.mention-me.com/sign-in";
  const MERCHANT_WINDOW_KEY = "__mmMerchantContext";
  const publishMerchant = data => {
    window[MERCHANT_WINDOW_KEY] = data;
    window.dispatchEvent(new CustomEvent("mm-merchant-ready", {
      detail: data
    }));
  };
  const clearMerchant = () => {
    delete window[MERCHANT_WINDOW_KEY];
  };
  const BADGE_ID = "mm-partner-badge";
  const showPartnerBadge = (partnerData, source) => {
    if (document.getElementById(BADGE_ID)) return;
    const nav = document.getElementById("navigation-items");
    if (!nav || !nav.parentNode) return;
    const badge = document.createElement("div");
    badge.id = BADGE_ID;
    badge.className = "mm-partner-badge";
    const hasName = partnerData.displayName && partnerData.displayName !== partnerData.partnerCode;
    const heading = hasName ? escapeHtml(partnerData.displayName) : escapeHtml(partnerData.partnerCode);
    const code = hasName ? escapeHtml(partnerData.partnerCode) : "";
    const codeStr = code ? ' <span class="mm-partner-badge-code">' + code + '</span>' : '';
    const resetTitle = source === "clerk" ? "Sign out and switch account" : "Clear personalisation";
    badge.innerHTML = '<div class="mm-partner-badge-inner">' + '<span class="mm-partner-badge-content">' + '<span class="mm-partner-badge-context">Personalised for </span>' + '<span class="mm-partner-badge-name">' + heading + '</span>' + codeStr + '</span>' + '<button class="mm-partner-badge-reset" title="' + resetTitle + '">&times;</button>' + '</div>';
    nav.parentNode.insertBefore(badge, nav);
    badge.querySelector(".mm-partner-badge-reset").addEventListener("click", e => {
      e.preventDefault();
      e.stopPropagation();
      if (source === "clerk" && window.Clerk && window.Clerk.signOut) {
        clearMerchant();
        const redirect = SIGN_IN_BASE + "?redirect_url=" + encodeURIComponent(window.location.href);
        window.Clerk.signOut().then(() => {
          window.location.href = redirect;
        }).catch(() => {
          window.location.reload();
        });
        return;
      }
      clearStoredPartner();
      window.location.reload();
    });
  };
  const removePartnerBadge = () => {
    const el = document.getElementById(BADGE_ID);
    if (el) el.remove();
  };
  const showNotices = () => {
    document.querySelectorAll("[data-mm-sign-in]").forEach(el => {
      el.style.display = "";
    });
    const redirect = SIGN_IN_BASE + "?redirect_url=" + encodeURIComponent(window.location.href);
    document.querySelectorAll("[data-mm-sign-in-link]").forEach(a => {
      a.href = redirect;
    });
  };
  const hideNotices = () => {
    document.querySelectorAll("[data-mm-sign-in]").forEach(el => {
      el.style.display = "none";
    });
  };
  const walkCodeBlocks = replacements => {
    document.querySelectorAll("pre code").forEach(codeEl => {
      let html = codeEl.innerHTML;
      if (replacements) {
        for (const [from, to] of replacements) {
          html = html.split(from).join(escapeHtml(to));
        }
      }
      const paramStyle = "color:inherit;filter:brightness(110%);font-weight:bold;text-decoration:underline;cursor:pointer";
      html = html.replace(/(\?|&amp;)([a-z_]+)=/g, (match, prefix, name) => {
        const slug = name.replace(/_/g, "-");
        const target = document.getElementById("param-" + slug);
        if (!target) return match;
        return prefix + '<a href="#param-' + slug + '" style="' + paramStyle + '">' + name + "</a>=";
      });
      codeEl.innerHTML = html;
    });
  };
  const observeTabSwitches = callback => {
    let processing = false;
    const observer = new MutationObserver(() => {
      if (processing) return;
      processing = true;
      setTimeout(() => {
        callback();
        processing = false;
      }, 50);
    });
    setTimeout(() => {
      const tabs = document.querySelector("[role='tablist']");
      if (tabs && tabs.parentElement) {
        observer.observe(tabs.parentElement, {
          attributes: true,
          subtree: true,
          childList: true
        });
      }
    }, 500);
  };
  const pollForClerk = (onReady, onTimeout) => {
    let n = 0;
    const tick = () => {
      if (window.Clerk && window.Clerk.loaded) {
        return onReady(window.Clerk);
      }
      if (++n < 40) {
        setTimeout(tick, 250);
      } else {
        onTimeout();
      }
    };
    setTimeout(tick, 100);
  };
  const fetchMerchantFromAPI = () => {
    return fetch(API_BASE + "/api/docs/context", {
      credentials: "include",
      cache: "no-store"
    }).then(res => res.ok ? res.json() : null);
  };
  useEffect(() => {
    let cancelled = false;
    const urlPartner = captureQueryParams();
    const onPersonalised = (merchant, source) => {
      if (cancelled) return;
      const replacements = [["YOUR_PARTNER_CODE", merchant.partnerCode]];
      if (merchant.displayName) {
        replacements.push(["YOUR_TRADING_NAME", merchant.displayName]);
      }
      hideNotices();
      showPartnerBadge(merchant, source);
      walkCodeBlocks(replacements);
      observeTabSwitches(() => walkCodeBlocks(replacements));
    };
    const onUnauth = () => {
      if (cancelled) return;
      clearMerchant();
      removePartnerBadge();
      showNotices();
      walkCodeBlocks(null);
      observeTabSwitches(() => walkCodeBlocks(null));
    };
    const tryUrlFallback = () => {
      if (cancelled) return;
      if (urlPartner) {
        onPersonalised(urlPartner, "url");
      } else {
        onUnauth();
      }
    };
    if (!document.cookie.includes("__client_uat")) {
      tryUrlFallback();
      return;
    }
    pollForClerk(clerk => {
      if (cancelled) return;
      if (!clerk.session) {
        tryUrlFallback();
        return;
      }
      fetchMerchantFromAPI().then(data => {
        if (data) {
          publishMerchant(data);
          onPersonalised(data, "clerk");
        } else {
          tryUrlFallback();
        }
      }).catch(() => tryUrlFallback());
    }, () => {
      if (!cancelled) tryUrlFallback();
    });
    return () => {
      cancelled = true;
    };
  }, []);
  return null;
};

<MerchantContext />

## Why the Referrer Tag Matters

Mention Me offers referral and influencer solutions. This essential tag allows us to show promotional offers and track customer activity.

### What Does the Referrer Tag Do?

<CardGroup cols={2}>
  <Card title="Promotes your referral programme" icon="bullhorn">
    Personalised messages encouraging customers to refer.
  </Card>

  <Card title="Closes the loop for rewards" icon="circle-check">
    Tracks when referred friends buy so referrers get rewarded.
  </Card>

  <Card title="Tracks influencer campaigns" icon="users">
    Logs follower transactions so influencers are rewarded accurately.
  </Card>

  <Card title="Supports other goals" icon="arrows-to-dot">
    Follow-up content like discounts or NPS surveys.
  </Card>
</CardGroup>

## How to Integrate the Referrer Tag

<SignInNotice />

<Tabs>
  <Tab title="Popup (default)">
    <Steps>
      <Step title="Add the JavaScript tag">
        Include the following JavaScript snippet at the bottom of the `<body>` tag on the order confirmation page (and optionally on other pages too). The request includes your unique partner code and mandatory customer and order parameters.

        <CodeGroup>
          ```html Demo theme={null}
          <!-- Begin Mention Me referrer integration -->
          <script type="text/javascript"
            src="https://tag-demo.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=<INSERT_FIRSTNAME>&surname=<INSERT_SURNAME>&email=<INSERT_EMAIL>&order_number=<INSERT_ORDER_NUMBER>&order_subtotal=<INSERT_ORDER_SUBTOTAL>&order_currency=<INSERT_ORDER_CURRENCY>&situation=<INSERT_SITUATION>&locale=<INSERT_LOCALE>&coupon_code=<INSERT_COUPON_CODE>&order_discount_amount=<INSERT_ORDER_DISCOUNT_AMOUNT>&order_item_count=<INSERT_ORDER_ITEM_COUNT>">
          </script>
          <!-- End Mention Me referrer integration -->
          ```

          ```html Live theme={null}
          <!-- Begin Mention Me referrer integration -->
          <script type="text/javascript"
            src="https://tag.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=<INSERT_FIRSTNAME>&surname=<INSERT_SURNAME>&email=<INSERT_EMAIL>&order_number=<INSERT_ORDER_NUMBER>&order_subtotal=<INSERT_ORDER_SUBTOTAL>&order_currency=<INSERT_ORDER_CURRENCY>&situation=<INSERT_SITUATION>&locale=<INSERT_LOCALE>&coupon_code=<INSERT_COUPON_CODE>&order_discount_amount=<INSERT_ORDER_DISCOUNT_AMOUNT>&order_item_count=<INSERT_ORDER_ITEM_COUNT>">
          </script>
          <!-- End Mention Me referrer integration -->
          ```
        </CodeGroup>

        The JavaScript runs after the rest of the page has loaded, populates the div above with the content.
      </Step>

      <Step title="Customise the parameters">
        Customise any passed parameters to pass the real data. Don't forget to URL encode your data.

        <Snippet file="url-encoding-info.mdx" />
      </Step>
    </Steps>
  </Tab>

  <Tab title="Embedded iframe">
    <Steps>
      <Step title="Add the wrapper div">
        Include the following `<div>` into your page where you want the iframe to appear.

        ```html theme={null}
        <!-- Begin Mention Me referrer placeholder div -->
        <div id="mmWrapper"></div>
        <!-- End Mention Me referrer placeholder div -->
        ```

        This is just a placeholder which is populated via the JavaScript tag. You can optionally apply a class or style to the div, via the Mention Me dashboard, if you wish to control the way the contents are styled. If you need to change the id on the wrapper (for example if you need two tags on one page), you can customise from within the Mention Me dashboard.
      </Step>

      <Step title="Add the JavaScript tag">
        Include the following JavaScript snippet at the bottom of the `<body>` tag on the order confirmation page (and optionally on other pages too). The request includes your unique partner code and mandatory customer and order parameters.

        <CodeGroup>
          ```html Demo theme={null}
          <!-- Begin Mention Me referrer integration -->
          <script type="text/javascript"
            src="https://tag-demo.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=<INSERT_FIRSTNAME>&surname=<INSERT_SURNAME>&email=<INSERT_EMAIL>&order_number=<INSERT_ORDER_NUMBER>&order_subtotal=<INSERT_ORDER_SUBTOTAL>&order_currency=<INSERT_ORDER_CURRENCY>&situation=<INSERT_SITUATION>&locale=<INSERT_LOCALE>&coupon_code=<INSERT_COUPON_CODE>&order_discount_amount=<INSERT_ORDER_DISCOUNT_AMOUNT>&order_item_count=<INSERT_ORDER_ITEM_COUNT>&implementation=embed">
          </script>
          <!-- End Mention Me referrer integration -->
          ```

          ```html Live theme={null}
          <!-- Begin Mention Me referrer integration -->
          <script type="text/javascript"
            src="https://tag.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=<INSERT_FIRSTNAME>&surname=<INSERT_SURNAME>&email=<INSERT_EMAIL>&order_number=<INSERT_ORDER_NUMBER>&order_subtotal=<INSERT_ORDER_SUBTOTAL>&order_currency=<INSERT_ORDER_CURRENCY>&situation=<INSERT_SITUATION>&locale=<INSERT_LOCALE>&coupon_code=<INSERT_COUPON_CODE>&order_discount_amount=<INSERT_ORDER_DISCOUNT_AMOUNT>&order_item_count=<INSERT_ORDER_ITEM_COUNT>&implementation=embed">
          </script>
          <!-- End Mention Me referrer integration -->
          ```
        </CodeGroup>

        The JavaScript runs after the rest of the page has loaded, populates the div above with the content.
      </Step>

      <Step title="Customise the parameters">
        Customise any passed parameters to pass the real data. Don't forget to URL encode your data.

        <Snippet file="url-encoding-info.mdx" />
      </Step>
    </Steps>
  </Tab>

  <Tab title="Link to overlay">
    <Steps>
      <Step title="Add the wrapper div">
        Include the following `<div>` into your page where you want the link to appear.

        ```html theme={null}
        <!-- Begin Mention Me referrer placeholder div -->
        <div id="mmWrapper"></div>
        <!-- End Mention Me referrer placeholder div -->
        ```

        This is just a placeholder which is populated via the JavaScript tag. You can optionally apply a class or style to the div, via the Mention Me dashboard, if you wish to control the way the contents are styled. If you need to change the id on the wrapper (for example if you need two tags on one page), you can customise from within the Mention Me dashboard.
      </Step>

      <Step title="Add the JavaScript tag">
        Include the following JavaScript snippet at the bottom of the `<body>` tag on the order confirmation page (and optionally on other pages too). The request includes your unique partner code and mandatory customer and order parameters.

        <CodeGroup>
          ```html Demo theme={null}
          <!-- Begin Mention Me referrer integration -->
          <script type="text/javascript"
            src="https://tag-demo.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=<INSERT_FIRSTNAME>&surname=<INSERT_SURNAME>&email=<INSERT_EMAIL>&order_number=<INSERT_ORDER_NUMBER>&order_subtotal=<INSERT_ORDER_SUBTOTAL>&order_currency=<INSERT_ORDER_CURRENCY>&situation=<INSERT_SITUATION>&locale=<INSERT_LOCALE>&coupon_code=<INSERT_COUPON_CODE>&order_discount_amount=<INSERT_ORDER_DISCOUNT_AMOUNT>&order_item_count=<INSERT_ORDER_ITEM_COUNT>&implementation=link">
          </script>
          <!-- End Mention Me referrer integration -->
          ```

          ```html Live theme={null}
          <!-- Begin Mention Me referrer integration -->
          <script type="text/javascript"
            src="https://tag.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=<INSERT_FIRSTNAME>&surname=<INSERT_SURNAME>&email=<INSERT_EMAIL>&order_number=<INSERT_ORDER_NUMBER>&order_subtotal=<INSERT_ORDER_SUBTOTAL>&order_currency=<INSERT_ORDER_CURRENCY>&situation=<INSERT_SITUATION>&locale=<INSERT_LOCALE>&coupon_code=<INSERT_COUPON_CODE>&order_discount_amount=<INSERT_ORDER_DISCOUNT_AMOUNT>&order_item_count=<INSERT_ORDER_ITEM_COUNT>&implementation=link">
          </script>
          <!-- End Mention Me referrer integration -->
          ```
        </CodeGroup>

        The JavaScript runs after the rest of the page has loaded, populates the div above with the content.
      </Step>

      <Step title="Customise the parameters">
        Customise any passed parameters to pass the real data. Don't forget to URL encode your data.

        <Snippet file="url-encoding-info.mdx" />
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Verb Aliases in the URL

The verb in the URL path (`referreroffer`) can be replaced with `offer` or `conversion` - all three behave identically. Pick whichever reads best in your codebase, for example `/api/v2/conversion/YOUR_PARTNER_CODE?...`.

## Mandatory Data Parameters

These are required to ensure that your referral programme runs correctly.

<ResponseField name="firstname" type="string" required>
  The customer's firstname. Please URL encode. Example: `Franklin`
</ResponseField>

<ResponseField name="surname" type="string" required>
  The customer's surname. Please URL encode. Example: `McFly`
</ResponseField>

<ResponseField name="email" type="string" required>
  The customer's email address. Please URL encode. Example: `franklinmcfly559@mention-me.com`
</ResponseField>

<ResponseField name="order_number" type="string" required>
  The unique order identifier from your system. Has a maximum of 50 characters. Example: `8494024521`
</ResponseField>

<ResponseField name="order_subtotal" type="string" required>
  The order subtotal (excluding VAT/taxes and shipping) in the currency indicated by the `order_currency` parameter. If you can't remove VAT, let us know. Example: `106.75`
</ResponseField>

<ResponseField name="order_currency" type="string" required>
  The three character (ISO 4217) currency code that the order total is in. Example: `GBP`
</ResponseField>

<ResponseField name="situation" type="string" required>
  String indicator of where you are including this tag within your site (for example: `checkout`, `postpurchase`, `landingpage`). Used for reporting. Has a maximum of 50 characters. Example: `postpurchase`
</ResponseField>

<ResponseField name="locale" type="string" required>
  String representing the required locale for the campaign. Used to show the right locale (language, currency) for the user. The format should be <a href="https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes" target="_blank" rel="noopener noreferrer">ISO 639-1</a> language code, an underscore (`_`), then the <a href="https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes" target="_blank" rel="noopener noreferrer">ISO 3166-1 alpha-2</a> country code (e.g. `fr_FR` for French/France). Default is empty (which will result in a locale of `en_GB` being assumed). When launching your first referral programme, we recommend targeting your main regions/locales first, based on volume. You can also group together and target certain regions with the same campaign if using the same language and currency (e.g. `en_EU` for all countries that have English as their language and Euro as their currency). If your referral programme offers third-party vouchers (e.g. Amazon gift card), check if they can support the locales you're promoting to. Example: `en_GB`
</ResponseField>

<ResponseField name="coupon_code" type="string" required>
  The coupon code used by the customer (if any). Example: `ABC4577`
</ResponseField>

## Extra Parameters to Drive Referral Optimisation

Add these data parameters to significantly improve performance.

<ResponseField name="order_discount_amount" type="string">
  The discount amount - our assumption is this has already been taken off the order subtotal provided. This allows us to calculate the Cost Per Acquisition for referral. Example: `23.49`
</ResponseField>

<ResponseField name="order_item_count" type="string">
  The number of items in the basket (if applicable). This helps us understand the type of purchase and can be a signal of advocacy. Example: `1`
</ResponseField>

<ResponseField name="order_is_subscription" type="string">
  Whether this order is for a subscription (recurring). This helps us qualify and categorise the revenue. Example: `false`
</ResponseField>

<ResponseField name="order_is_gift" type="string">
  Whether this order is a gift (being bought for someone else). Gifts can be signals of advocacy. Example: `false`
</ResponseField>

<ResponseField name="customer_id" type="string">
  The unique customer identifier from your system. Example: `MI1404024521`
</ResponseField>

## Extra Parameters for Product Referral

If you are using [Product Referral](/developer-docs/integration/entry-points/product-referral), add these parameters to your referrer tag to enable product-level conversion tracking. See the [product referral instructions](/developer-docs/integration/entry-points/product-referral) for full details.

<ResponseField name="product_ids" type="string">
  Comma-separated list of product IDs included in the order.
</ResponseField>

<ResponseField name="product_skus" type="string">
  Comma-separated list of product SKUs included in the order.
</ResponseField>

<ResponseField name="product_names" type="string">
  Comma-separated list of product names included in the order.
</ResponseField>

<ResponseField name="product_prices" type="string">
  Comma-separated list of product prices included in the order.
</ResponseField>

<ResponseField name="product_quantities" type="string">
  Comma-separated list of product quantities included in the order.
</ResponseField>

<Accordion title="Optional data parameters">
  <ResponseField name="phone_number" type="string">
    The customer's phone number(s). Pass as many phone numbers as you have as a comma-separated list. If you are passing any data which is not a digit (e.g. spaces, +'s), these need to be URL encoded.
  </ResponseField>

  <ResponseField name="title" type="string">
    The customer's title. This allows you to have more formal messaging in your flow. Has a maximum of 20 characters.
  </ResponseField>

  <ResponseField name="fullname" type="string">
    The customer's full name. Please URL encode.
  </ResponseField>

  <ResponseField name="username" type="string">
    The customer's username. Your account is set up for referrers to share using their username not full name. Please URL encode.
  </ResponseField>

  <ResponseField name="segment" type="string">
    String representing a customer segment (for example one of: men, women) used to pass segmentation data about your customer to us. Has a maximum of 50 characters.
  </ResponseField>

  <ResponseField name="custom_field" type="string">
    Any piece of custom data you wish to pass to us.
  </ResponseField>

  <ResponseField name="address_line1" type="string">
    The customer's address line 1 (if known).
  </ResponseField>

  <ResponseField name="address_line2" type="string">
    The customer's address line 2 (if known).
  </ResponseField>

  <ResponseField name="address_city" type="string">
    The customer's address city (if known).
  </ResponseField>

  <ResponseField name="address_county" type="string">
    The customer's address county (if known).
  </ResponseField>

  <ResponseField name="address_postcode" type="string">
    The customer's address postcode (if known).
  </ResponseField>

  <ResponseField name="address_country" type="string">
    The customer's address country (if known).
  </ResponseField>

  <ResponseField name="custom_share_field" type="string">
    A piece of text you can use to pass into sharing widgets, such as what the user bought or how much they saved.
  </ResponseField>

  <ResponseField name="order_date" type="string">
    The date and time the order was placed. The format must be in ISO 8601 format and URL encoded. If not provided or invalid, we will use the date and time at the point we received the tag.
  </ResponseField>

  <ResponseField name="mm_encrypted" type="string">
    In some cases it may be desirable to ensure that email addresses and other information is not in clear text. See [encrypted parameters](/developer-docs/integration/encrypted-parameters).
  </ResponseField>
</Accordion>

<Accordion title="Optional implementation parameters">
  <ResponseField name="implementation" type="string">
    Optionally override the way the flow is implemented (one of: `link`, `form`, `embed`). Default can also be set in the merchant dashboard. If in doubt, leave out.
  </ResponseField>

  <ResponseField name="variation" type="string">
    Integer representing the index of an offer within an experiment. Used to override the dynamic allocation of offers to customers so that, for example, email creative can be set up to show a specific variation. Default is null.
  </ResponseField>
</Accordion>

## Example with All Mandatory Parameters Populated

<CodeGroup>
  ```html Demo theme={null}
  <!-- Begin Mention Me referrer integration -->
  <script type="text/javascript"
    src="https://tag-demo.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=Franklin&surname=McFly&email=franklinmcfly559@mention-me.com&order_number=8494024521&order_subtotal=106.75&order_currency=GBP&situation=postpurchase&locale=en_GB&coupon_code=ABC4577&order_discount_amount=23.49&order_item_count=1&order_is_subscription=false&order_is_gift=false&customer_id=MI1404024521">
  </script>
  <!-- End Mention Me referrer integration -->
  ```

  ```html Live theme={null}
  <!-- Begin Mention Me referrer integration -->
  <script type="text/javascript"
    src="https://tag.mention-me.com/api/v2/referreroffer/YOUR_PARTNER_CODE?firstname=Franklin&surname=McFly&email=franklinmcfly559@mention-me.com&order_number=8494024521&order_subtotal=106.75&order_currency=GBP&situation=postpurchase&locale=en_GB&coupon_code=ABC4577&order_discount_amount=23.49&order_item_count=1&order_is_subscription=false&order_is_gift=false&customer_id=MI1404024521">
  </script>
  <!-- End Mention Me referrer integration -->
  ```
</CodeGroup>

## Things to Watch Out For

<AccordionGroup>
  <Accordion title="The tag doesn't seem to be working. What should I do?">
    Check the browser developer console for errors from the Mention Me tag. Most integration issues come down to a missing mandatory parameter, an un-encoded value, or the demo host being left in the live snippet. See the [common tag integration errors](/developer-docs/integration/reference/faqs#common-tag-integration-errors) and [error codes](/developer-docs/integration/reference/error-codes) for the full checklist.
  </Accordion>

  <Accordion title="The customer's name isn't populated in the overlay">
    The most common reasons are that `firstname` and `surname` are not being rendered into the tag URL (the snippet still contains `<INSERT_FIRSTNAME>` / `<INSERT_SURNAME>`), or the values are not URL encoded. Customer names with accented characters or spaces must be URL encoded before being written into the URL.
  </Accordion>

  <Accordion title="How do I exclude VAT and shipping from the order total?">
    `order_subtotal` must be the order subtotal **excluding VAT/taxes and shipping** - this is the figure the referral reward is calculated against. If you cannot remove VAT on your side, let your Client Success Manager know and we can handle the adjustment.
  </Accordion>

  <Accordion title="Why are firstname and surname mandatory?">
    The referrer tag personalises the sharing experience using the customer's real name (for example, "Franklin recommends…"). Without a name we cannot build that sharing message, which dramatically reduces referral performance. If your account is configured to share by username instead, use the `username` parameter - but the referral programme still needs a name for display in some flows.
  </Accordion>
</AccordionGroup>
