It's possible to add PixelFlow to load within Google Tag Manager, which can be useful for cookie consent and centralized script management if you already use GTM for this.
How to set up PixelFlow with Google Tag Manager
Get your PixelFlow script snippet - PixelFlow will give you a script tag that looks something like this (example):
<script>!(function(p,i,x,f,l,o,w){p["PixelFlowObject"]=f;p[f]=p[f]||function(){(p[f].q=p[f].q||[]).push(arguments);};p[f].l=1*new Date();o=i.createElement(x);w=i.getElementsByTagName(x)[0];o.src=l;o.async=1;p[f].apiKey="5f1567378cdfg46ccc7785006ba439acddc93";p[f].siteId="68ieiui9db6393302c3";p[f].apiEndpoint="https://api.pixelflow.so/event";w.parentNode.insertBefore(o,w);})(window,document,"script","pixelFlow","https://slrgkgulru.pixelflow.so/pfm.js");</script>You can find your script anytime by going to your Overview page and clicking on the copy code button in the "Sites" section
Log in to Google Tag Manager - Go to tagmanager.google.com
Create a new tag:
In the left menu, click Tags → New
Click Tag Configuration
Choose Custom HTML
Paste the PixelFlow script - Paste your PixelFlow script into the HTML box.
Set the trigger - Click Triggering and choose All Pages (or specific pages if you only want it on certain ones). This ensures PixelFlow loads on every page where you want tracking active.
Test and publish:
Click Preview to open Tag Assistant and confirm the PixelFlow script loads correctly.
If it does, click Submit → Publish to make it live.
Once published, PixelFlow will load through Google Tag Manager on all specified pages, making it easier to manage alongside your consent tools.
How to Setup Google Tag Manager to Require Consent Before Loading
If you would like to setup Google Tags Manager to only load the PixelFlow script if the required marketing consent is given (ad_storage) you can do this using Google Consent Mode v2:
Click Tags
Edit your PixelFlow tag
Click Advanced Settings
Click "Require additional consent for tag to fire"
Choose
ad_storage
Press Save
Publish your changes in GTM
GTM will now ONLY load PixelFlow if the user has provided "ad_storage" (Marketing) permissions via whatever consent management plugin you're using.
Your script will now only load AFTER the user has accepted the consent AND when the page reloads. To ensure the script triggers WITHOUT having to reload the page you can add one additional consent trigger in GTM
How to Ensure GTM Immediately Loads Script After Consent Rather Than Only After Page Refresh
The default behaviour for a script requiring consent to run is the following:
Page Load
Ask for consent
Load script on next page load
This means the script will only load if the user refreshes the page or loads a new page, which is not ideal as you could miss certain interactions on your website. To resolve this, you can simple add a new trigger in GTM to run the script when consent is given.
If you use a consent management plugin like Cookiebot, OneTrust, Iubenda etc. you'll need to enable their integration with GTM to handle consent and trigger the script loading after consent. Your consent management plugin should send consent values into GTM typically through the dataLayer and you can then use that as a trigger to run the script without waiting for a new page load.
Adding A Trigger to Load the Script in GTM After Consent
Follow these steps to add a new trigger for loading the script after consent is given (without having to wait for a page load). In Google Tag Manager:
Click Triggers
Click New
Click the box to add a new trigger type
Select Custom Event
In the Event Name, enter
cookie_consent_update(you can replace this with whatever event name your cookie consent plugin is passing to GTM to notify it of consent)Name the Event cookie_consent_update
Press Save
Click Tags
Click your PixelFlow tag ("custom HTML")
Click "Triggering" and you'll see a + icon to add a new trigger
Click the plus icon
Select the new "cookie consent update" trigger you created
Press Save
Publish changes
You're now triggering the PixelFlow script to run on:
Immediately when consent is given without waiting for a new page load
All other page loads that happen after this