AFL UTM Tracker Documentation

  1. Home
  2. Docs
  3. AFL UTM Tracker Documentation
  4. Cookie Consent Banner Integration
  5. Google Consent Mode Integration

Google Consent Mode Integration

You can integrate our AFL UTM Tracker plugin with your Consent Management Platform (CMP) through the Google Consent Mode.

The AFL UTM Tracker plugin will “opt-in” or “opt-out” of cookies based on the consent update event from Google Consent Mode.

The steps below involves using our Google Tag Manager template. It supports 2 types of consent category:

  • analytics_storage for Statistics
  • ad_storage for Marketing

Minimum Requirements:

  • AFL UTM Tracker v2.14.7
  • Google Tag Manager
  • Consent Management Platform (CMP) that supports Google Consent Mode

Google Tag Manager Template Changelog

Version 1.1.0 – 2024-06-20

– Fix bug where Last Touch is not being updated.
– You will need to change the tag trigger to “DOM Ready” and remove the old trigger which was set to trigger before the CMP fires.

Version 1.0.0 – 2024-02-06

  • First released.

Steps

WordPress Admin

  1. Login to your WordPress dashboard.
  2. Under the AFL UTM Tracker menu > Settings.
  3. Look for the Cookie Consent Integration section.
  4. Select ‘GTM / Manual‘ from the drop-down list.
  5. Save setting.
  6. Clear all page cache.

NOTE: Changing the Consent Category in our plugin setting does not affect the Consent Category in your our Google Tag Manager (GTM) template. The Require Consent field set in our GTM tag will be the main source.

Importing the GTM template

  1. Download our Google Tag Manager template.
  2. Login your Google Tag Manager dashboard.
  3. Go to your website’s container.
  4. Under Templates > New.
  5. Click the burger menu > Import.
  6. Select “AFL UTM Tracker – Google Consent Mode.tpl” file.
  7. Save.
GTM Templates > New
GTM Templates > New
GTM Template > Import
GTM Template > Import
GTM Template > AFL UTM Tracker - Google Consent Mode
GTM Template > AFL UTM Tracker – Google Consent Mode

Adding Tag

  1. Under Tags > New.
  2. Name the tag ‘AFL UTM Tracker – Google Consent Mode’.
  3. Tag Configuration > Choose tag type > Custom > AFL UTM Tracker – Google Consent Mode.
  4. Set Required Consent field.
    • Select ‘analytics_storage’ if you are collecting the user’s UTM report for statistics purposes.
    • Select ‘ad_storage’ if you are collecting the user’s UTM report for marketing purposes.
  5. Under the Triggering section:
    • Set it to trigger during the “DOM Ready” event.
  6. Save.
GTM > Tags > New > Choose Tag Type
GTM > Tags > New > Choose Tag Type
GTM > Tag > AFL UTM Tracker > Set Required Consent
GTM > Tag > AFL UTM Tracker > Set Required Consent
Trigger AFL UTM Tracker tag on DOM Ready
Trigger AFL UTM Tracker tag on DOM Ready

Consent Management Tag

Depending on the Required Consent value above, make sure that you have the appropriate Consent Category already setup in your Consent Management Platform tag.

For example, if you have selected ‘analytics_storage’ above:

  • Check if your CMP already has a Consent Category for Statistics / analytics_storage.
  • Check if your CMP needs to register a list of our plugin cookies.

If your CMP needs you to register each cookies individually, here is our List of Cookies and Purposes.

If your CMP supports registering by cookie prefix:

afl_wc_utm*

Testing the Tag

  1. Next Preview your workspace.
  2. Launch your website through the debugger.
  3. Right click > Inspect Element or open your browser developer tool.
  4. Go to the Application tab > Cookies > Select your website URL.

Test Opt-in

  1. Click on your Cookie Consent Banner to allow consent for Statistics purposes.
  2. Under the Cookies list, watch as our cookies with the prefix ‘afl_wc_utm_’ being generated.

Test Opt-out

  • Click on your Cookie Consent Banner to reject consent for Statistics purposes.
  • Under the Cookies list, watch as our cookies are deleted. You might need to right click on the list to Refresh.

If everything works, go ahead and publish your workspace changes.

Do drop us an email with your website link for us to audit.