To integrate with Mention Me on your SAP Commerce Cloud website, we recommend using our Javascript tag based integration and configuring within Google Tag Manager.
Alternatively, you can directly integrate the Mention Me Javascript tags into your SAP Commerce Cloud storefront by following our standard integration instructions.
These documents explain how to integrate Google Tag Manager with SAP Commerce Cloud:
- Integrating Web Analytics with your SAP Commerce Cloud Storefront - An Overview
- Implementing Google Analytics with SAP Commerce Cloud
To integrate with Mention Me using Google Tag Manager, specific variables will need to be in the tag container’s data layer that include customer and order information.
This guide assumes that you have configured the purchase action for advanced ecommerce for Universal Analytics or ecommerce for GA4 to make the order information available in your data layer. Otherwise you will need to look up your custom data layer paths for those variables.
Referrer Integration
You can configure the referrer Javascript tag entirely within Google Tag Manager using variables, a trigger, and a tag.
Variables
We give these variable names and data layer paths as guidance. If you already have variables, the names and paths may differ.
Parameter | Description | Example |
---|---|---|
Customer firstname | The customer's firstname. Please URL encode. | Monica |
Customer surname | The customer's surname. Please URL encode. | Collins |
Customer email | The customer's email address. Please URL encode. | monicacollins195@mention-me.com |
Order subtotal | 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 | 95.75 |
Order currency code | The three character (ISO 4217) currency code that the order total is in (data layer path of ecommerce.currencyCode) | GBP |
Order ID | The unique order identifier. Has a maximum number of 50 characters. (data layer path of ecommerce.purchase.actionField.id) | 9947550576 |
Customer locale | String representing the required locale for the campaign. Used to show the right locale (language, currency) for the user. The format should be ISO 639-1 language code, an underscore (_ ), then the ISO 3166-1 alpha-2 country code (e.g. fr_FR for French/France). |
en_GB |
Trigger
You should include the referrer Javascript tag on the order confirmation page. To do this, create a trigger for the tag.
As a page view trigger type
Use the page view trigger type to create a purchase trigger. This will be the trigger for the Mention Me referrer tag.
Tag
To create a Custom HTML tag, add this HTML:
<!-- Begin Mention Me referrer integration -->
<script type="text/javascript" src="https://tag.mention-me.com/api/v2/referreroffer/PARTNER_CODE?firstname={{ Customer first name }}&surname={{ Customer surname }}&email={{ Customer email address }}&order_number={{ Order ID }}&order_subtotal={{ Order subtotal }}&order_currency={{ Order currency code }}&situation=postpurchase&locale={{ Customer locale }}"></script>
<!-- End Mention Me referrer integration -->
You must replace PARTNER_CODE with your Mention Me partner code, which your Customer Success Manager can provide. It looks something like mmxxx00000.
Note: The various variables used in the URL parameters. You may have different variable names and will need to update the HTML accordingly.
Set the firing triggers to the purchase trigger so that this tag fires on the order confirmation page.
Adding the Custom HTML tag
Referee Integration
The referee integration lets referrers share with friends in everyday conversation using Name Share. The referee tag lets prospective new customers search for their friend’s name and claim an introductory reward.
Integrate this tag on the checkout page.
Variables
Parameter | Description | Example |
---|---|---|
Customer locale | String representing the required locale for the campaign. Used to show the right locale (language, currency) for the user. The format should be ISO 639-1 language code, an underscore (_ ), then the ISO 3166-1 alpha-2 country code (e.g. fr_FR for French/France). |
en_GB |
Trigger
You should include the referee Javascript tag on the order confirmation page. To do this, create a trigger for the tag.
As a page view trigger type
Use the page view trigger type to create a checkout trigger. This will be used as the trigger for the Mention Me referee tag.
Tag
To create a Custom HTML tag, add this HTML:
<!-- Begin Mention Me referee integration -->
<script type="text/javascript" src="https://tag.mention-me.com/api/v2/refereefind/PARTNER_CODE?situation=checkout&locale={{ Customer locale }}"></script>
<!-- End Mention Me referee integration -->
You must replace PARTNER_CODE with your Mention Me partner code, which your Customer Success Manager can provide. It looks something like mmxxx00000.
Note: the Customer locale variable used in the URL parameters. You may have a different variable name and will need to update the HTML accordingly.
Set the firing triggers to the checkout trigger so that this tag fires on the checkout page.
Adding the Custom HTML tag
HTML Changes
Add the following HTML to the checkout page (typically above any coupon code field):
<!-- Begin Mention Me referee placeholder div -->
<div id="mmWrapper"></div>
<!-- End Mention Me referee placeholder div -->
If you can’t make these changes, speak with our Onboarding team. They’ll target an existing HTML element on your checkout page instead.
SAP Commerce Cloud Accelerators
When using the Coupon Module in SAP Commerce Cloud, see the documentation on Coupons in Accelerator for details on which JSP tags to update, specifically yacceleratorstorefront/web/webroot/WEB-INF/tags/responsive/cart/cartVoucher.tag.
Otherwise, you can make this change in yacceleratorstorefront/web/webroot/WEB-INF/views/responsive/pages/cart/cartTotalsDisplay.jsp or a referenced JSP tag file.
SAP Spartacus
Customise the Cart Coupon component’s HTML to include the Mention Me div element, just above the <div class="cx-cart-coupon-container"> element.