Skip to content
Login Contact

How to implement Marfeel SDK via GTM (Google Tag Manager)

The Marfeel SDK can be added to your pages in two ways: directly in your site HTML, or through Google Tag Manager for convenience. Loading via GTM is simpler to deploy but introduces tradeoffs around tracking accuracy and browser compatibility.

Data discrepancies:

Google Tag Manager delays the loading of Marfeel SDK, which has an important impact on traffic measurement accuracy. To prevent data discrepancies with other analytics tools, make sure the Marfeel SDK loads at the same exact time. For details on how SDK load timing affects measurement, see the SDK performance guide.

Safari and iOS limitations:

Safari 17 and iOS 17 block Google Tag Manager and Google Ads scripts on your pages. If Marfeel is loaded via GTM, it will not be able to track those sessions. We recommend adding the Marfeel SDK directly on your HTML to avoid this limitation.

  1. Log into your Google Tag Manager workspace
  2. Click Tags on the left-hand side
  3. Click New Google Tag Manager Tags panel showing the New button to create a tag|690x401
  4. Give your tag a name, like “Marfeel SDK”
  5. Under Tag Configuration, choose the “Custom HTML” tag type
  6. Copy the Marfeel SDK code Marfeel Hub tracking page with the SDK code snippet ready to copy|690x401
  7. Paste it into the “HTML” box GTM Custom HTML tag configuration with the Marfeel SDK code pasted in|690x401
  8. Under Triggering, select the All Pages trigger
  9. Click the blue Save button in the top right corner
Google AMP:
AMP does not fully support Google Tag Manager. Adding the SDK via GTM will not track your AMP pages. To track your AMP pages you will need to instrument them separately.

Adding the Marfeel SDK via Google Tag Manager delays when tracking begins on each page load. These delays, although subtle, can introduce precision mismatches between Marfeel and other analytics tools.

To minimize discrepancies, make sure the Marfeel SDK tag fires at the same moment as your other analytics tags. If precision is critical, consider adding the SDK directly to your HTML instead.