How do I integrate with Google Tag Manager using iFrames?

Here's a step by step guide on integrating GTM via iFrames as a Tradable Bits integration.

  1. In the Publish page of your campaign, grab the Tradable Bits embed code  (first code block under 1: Embed Widget) for use on your website. Use the Tradable Bits Embed code using embedded.js, do not use the iframe code provided below it:


2.  Place your GTM tag (or any global site tag for the network on which you want to track on ex.

Meta / Tiktok / Snapchat site tag) at the top of the site on which you will be embedding your campaign.

Example Meta Tag:


<script>

  !function(f,b,e,v,n,t,s)

  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?

  n.callMethod.apply(n,arguments):n.queue.push(arguments)};

  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';

  n.queue=[];t=b.createElement(e);t.async=!0;

  t.src=v;s=b.getElementsByTagName(e)[0];

  s.parentNode.insertBefore(t,s)}(window, document,'script',

  'https://connect.facebook.net/en_US/fbevents.js');

  fbq('init', '{your-pixel-id-goes-here}');

  fbq('track', 'PageView');

</script>


Example GTM Tag:


<script async src="https://www.googletagmanager.com/gtag/js?id=your-pixel-id-goes-here"></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'your-pixel-id-goes-here);

</script>

 

3. On the tracking page of the campaign, add the GTM tag (or fill any other tracking tags you need installed in accordance with the global tags you installed in the previous step ie. Meta/Tiktok/Snapchat):