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. Add Google Analytics to GTM
- If there is no custom event called “Consent”
- In GTM, go to Triggers
- click New and select Custom Event as trigger type
- Enter “cookie_consent_update” as Event Name
- Set the name to “Consent” and save
- Go to Tags
- Click New and select Google Analytics > Google Tag
- Set the Measurement ID to your GA4 measurement ID
- Add a trigger, set it to our Consent custom event
- Hit Save
2. Verify installation in GTM preview
Done
More reading