Analytics and CookiesGoogle Analytics

External Services

This document describes how inject external services into the application. The main outline is to add a GTM script in DatoCMS under “Site Settings” -> “External Services”, then the rest is managed inside GTM.

Pre-requisites

  1. GTM account
  2. GTM script in DatoCMS

1. Add Google Analytics to GTM

  1. If there is no custom event called “Consent”
    1. In GTM, go to Triggers
    2. click New and select Custom Event as trigger type
    3. Enter “cookie_consent_update” as Event Name
    4. Set the name to “Consent” and save
  2. Go to Tags
  3. Click New and select Google Analytics > Google Tag
  4. Set the Measurement ID to your GA4 measurement ID
  5. Add a trigger, set it to our Consent custom event
  6. Hit Save

2. Verify installation in GTM preview

Read instructions here

Done

More reading