Prepare your tracking setup
Cookies can be set in your visitors’ browsers by many tools and trackers. To comply with privacy regulations, you should ensure your tracking setup is consent-based.
The most effective way to manage tracking based on consent is to unify your tracking setup.
By consolidating all tracking scripts into one place - either in your website’s codebase or through a Tag Management System (TMS) like Google Tag Manager (GTM) - you can precisely control execution of the scripts based on your visitors’ consent choices.
In this guide, we’ll demonstrate how to prepare your setup using GTM.
Migrate your tracking scripts to Google Tag Manager
Section titled “Migrate your tracking scripts to Google Tag Manager”Most website platforms offer two ways to integrate marketing, analytical, and other tools:
- by adding custom code
- by using built-in integrations (often called Integrations, Apps, or Plugins)
To consolidate your setup:
- Review all tools that set cookies on your website. Check for custom code settings & integration settings.
- Migrate all scripts & integrations to GTM so your website only contains one integration - your GTM container.
Next, we’ll list some of the most commonly used tools, and how to migrate those to GTM.
Google Analytics 4
Section titled “Google Analytics 4”One of the most commonly used analytical tools is Google Analytics 4 (GA4).
On a Webflow website, GA4 is typically added in the following way:
To migrate it to GTM:
- Note your measurement ID and remove it from your website’s custom code or integration.
- Inside your GTM container, create a new tag. Tag type should be Google Tag. Inside the Tag ID, insert your measurement ID.
- Set the trigger to Initialization - All Pages.
Meta Ads
Section titled “Meta Ads”Another frequently used platform is Meta Ads and its data collection tool, the dataset (formerly known as pixel).
On a SquareSpace website, Meta Ads dataset is typically added in the following way:
To migrate it to GTM:
- Note your dataset ID and remove it from your website’s custom code or integration.
- Inside your GTM container, create a new tag. For the tag type, search for Facebook Pixel by facebookarchive in the tag gallery.
- Insert your dataset ID and select PageView under the event name.
- Set the trigger to Initialization - All Pages.
Other tools
Section titled “Other tools”Follow the same process to migrate any other integrations or scripts that set cookies. At the end of this process, your website should only have one integration: your GTM container.
Codebase (embedded) scripts
Section titled “Codebase (embedded) scripts”In development
After migrating your scripts to GTM, you may decide that for some reason, some of the scripts should stay in the codebase.
Alternatively, you decided that all your scripts will be managed in your codebase.
For those cases, Cookifi’s manual script blocking feature comes into play.
Tools that you don’t have control over
Section titled “Tools that you don’t have control over”In development
Lastly, there may be tools present on your website that set cookies, which you don’t have control over. A typical example is a plugin.
You can verify these by opening your browser’s Developer Tools and reviewing the cookies.
If you see cookies unrelated to scripts which you migrated to GTM, search Google for the cookie name to determine the plugin or tool responsible for this.
For these cookies, Cookifi’s auto blocking feature comes into play.