Tracking with Google Tag Manager using Custom Javascript


Floify's custom JavaScript feature allows you to integrate Google Tag Manager (GTM), tracking events, links, and more within Floify, reporting them back to GTM for analysis.

This guide assumes you have already enabled and configured GTM. For more information on GTM setup, see Google's documentation here.



How to Set Up

Find your GTM installation instructions in Google. This page will show some code for you to copy + paste:





In Floify, on the Company Dashboard, navigate to Company Settings > Developer > Company Custom CSS/JS and select Edit Company Custom Code:





Copy your GTM code and paste it in the Floify code editor. There should be two separate sections, which can be placed contiguously within the editor. Below that, you'll add some code that invokes GTM and generates an event. For example, in this case, the script checks the page URL for a referer, and sends that to GTM in a "floifyLoaded' event:


new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

<noscript><iframe src=""
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
const params = new URLSearchParams(;
const floifyReferer = params.get('floifyReferer');
console.log('floifyReferer: ' + floifyReferer);
gtag('event', 'floifyLoaded', {
'floifyReferer': floifyReferer




Once that's in place, Floify will send an event to your GTM every time a Floify page loads. Here we can see an example of how that data looks in GTM:





That's it! Now you can adapt the GTM code in Floify as needed to produce the specific tracking events you're looking for. 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Article is closed for comments.