How to deploy FunnelFlux Javascript with Google Tag Manager (GTM)
Google Tag Manager (GTM) lets you add and update tracking code (“tags”) on your website from the GTM web interface, without editing your pages each time. Once the GTM container snippet is on your pages, you can deploy the FunnelFlux Universal tracking script as a tag.
Read Google’s Google Tag Manager overview.
Get the Universal tracking script
Section titled “Get the Universal tracking script”- Sign in to FunnelFlux at
/admin/login.php. The app opens the Dashboard at/v2-ui/. - Go to Campaigns and open your funnel.
- Right-click the lander or offer node for the page and choose Send Traffic Here.
- In the Funnel URL window, turn on Use direct tracking.
- Copy the Universal tracking script.
The same script is on System Links under Get campaign link.
![]()
The script starts with <!-- FunnelFlux Tracking JS Start --> and ends with <!-- FunnelFlux Tracking JS End -->.
Copy all of it, including the <script> and </script> tags.
Create a FunnelFlux tag in Google Tag Manager
Section titled “Create a FunnelFlux tag in Google Tag Manager”- In your GTM workspace, open Tags and click New.
- Click Tag Configuration and choose Custom HTML.
- Paste the Universal tracking script into the HTML box.
- Under Advanced Settings, turn on Support document.write.
The FunnelFlux script can call
document.write()when it writes page content variations. - Click Triggering and choose All Pages, so the script runs on every page view.
- Name the tag, for example “FunnelFlux tracking”, and click Save.
See Google’s Custom tags help page.
![]()
![]()
If you use one GTM container across pages in different funnels, create one tag per page and use a Page View trigger that matches each page’s URL instead of All Pages. Each node’s script contains that node’s ID.
Place the Google Tag Manager code on your pages
Section titled “Place the Google Tag Manager code on your pages”In GTM, click your container ID (GTM-XXXX) at the top of the workspace, or go to Admin > Install Google Tag Manager.
Either shows two snippets.
![]()
Copy your code from that dialog rather than from the examples below, because Google occasionally updates it. See Google’s Install a web container help page.
- Paste the first snippet as high in the
<head>of your lander or offer page as possible, for example:
<head><!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXX');</script><!-- End Google Tag Manager -->
<!-- other head content -->
</head>- Paste the second snippet immediately after the opening
<body>tag, for example:
<body><!-- Google Tag Manager (noscript) --><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><!-- End Google Tag Manager (noscript) -->Note: FunnelFlux records a page visit only if the URL in the browser matches the URL of your lander or offer node, and it needs to know which funnel the user is in.
So either send traffic through a FunnelFlux redirect link, or use the Direct page URL from the Funnel URL window.
The Direct page URL includes the flux_fts parameter, which identifies the traffic source and funnel.
![]()
Using GTM to trigger events
Section titled “Using GTM to trigger events”GTM can also run tags when your page pushes an event, for example to fire a Meta Pixel event or a Google Analytics 4 event.
Create a trigger:
- Open Triggers and click New.
- Click Trigger Configuration and choose Custom Event.
- Set Event name to
test_event. - Name the trigger “My test event” and click Save.
![]()
Create a tag:
- Open Tags and click New.
- Name it “test tag”, choose Custom HTML, and paste this code:
<script> console.log("My trigger works!");</script>- Under Triggering, choose My test event and click Save.
Now push test_event from your page.
For example, change one of your CTA buttons to this:
<a href="#" onclick="dataLayer.push({'event': 'test_event'});">Button 1</a>When a user clicks the button:
- The page pushes
test_eventto the GTM data layer. - The My test event trigger matches the event.
- The “test tag” tag runs.
- “My trigger works!” appears in the browser console.
You can attach any number of tags to the same event, so one push can fire several analytics codes.
Preview and publish your GTM changes
Section titled “Preview and publish your GTM changes”Changes in GTM do not go live until you publish them.
Click Preview to open Tag Assistant and check which tags fire on your page. Only you see the preview, so use it to test before going live.
When all your tags fire correctly, click Submit in the upper right of the workspace, review your changes, and click Publish.
![]()
See Google’s Preview and debug containers and Publishing, versions, and approvals help pages.
Note: Universal Analytics stopped processing data in July 2023 and was replaced by Google Analytics 4. Use GA4 tags in GTM for Google Analytics; see Google’s announcement.

