Setup Filterly on your website

Below you will find instructions for setting up Filterly on your website.

Proxy GTM and GTAG

Load Google Tag Manager from Filterly

If you already have Google Tag Manager installed on your website you will have two pieces of code. They will look something like this:

<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:<br />new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],<br />j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=<br />’https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);<br />})(window,document,’script’,’dataLayer’,’GTM-XXXXXX’);</script>
<!– End Google Tag Manager –>

and

<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://<strong>www.googletagmanager.com</strong>/ns.html?id=GTM-TL4PG82″ height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>

In order to load Google Tag Manager and Google Analytics from Filterly you need to do the following:

  1. For the first part of the code, replace www.googletagmanager.com with cdn.filterly.eu
  2. For the second part of code, remove it fully from your website.

You will be left with something that looks like this:

<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:<br />new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],<br />j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=<br />’https://cdn.filterly.eu/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);<br />})(window,document,’script’,’dataLayer’,’GTM-XXXXXX’);</script>
<!– End Google Tag Manager –>

Save/Publish and verify that the changes are live.