GTM manages the
<script> tag only. The mmWrapper placeholder div still needs to be added directly to your checkout page template near the coupon entry field.1
Add the wrapper div to your page template
2
Push a data layer event on checkout page load
3
Create Data Layer Variables in GTM
Create a Data Layer Variable for
mmLocale (and any optional customer fields you’re passing).4
Create the Custom HTML tag
tag-demo.mention-me.com first, then switch to tag.mention-me.com.5
Set the trigger
Create a Custom Event trigger firing on
mentionMeReferee, scoped to the checkout page.6
Preview and publish
Confirm in GTM Preview mode that the “Been referred by a friend?” link or form renders on checkout, then publish.
Troubleshooting
The referee link doesn't appear
The referee link doesn't appear
Check that the
mentionMeReferee event is present in the data layer before GTM’s trigger evaluates it, and that the mmWrapper div exists in the page HTML (not just injected by GTM).Single-page checkout / dynamic routing
Single-page checkout / dynamic routing
If your checkout is a SPA and the referee tag needs to re-fire on route changes without a full page reload, see SPA Implementation - the same re-fire logic applies whether the tag is deployed directly or via GTM.