On this article, we assume that you have already created a GTM account, created a website container in GTM and added the GTM container snippet to your website as required: https://support.google.com/tagmanager/answer/6103696.
We also assume that Secure Privacy is already installed. To know more about how to implement Secure Privacy with GTM follow this article.
To configure prior consent, you need to add triggers of the respective script tags on your GTM. Follow these steps to enable Prior consent on your GTM.
- Identify all the plugins in which “Prior Consent” is needed. You can find the list of plugins on installation page. If you want to enable prior consent for any category go to Prior Consent page.
- From the GTM “Triggers” list, click “New”.
- Choose “Custom Event” and enter an event name for the trigger.
- Type sp-consent=”PLUGIN NAME”, in the field “Event name”. (The plugin name should be copied from the list of identified plugins, as described in Step 1)
If you are enabling Prior Consent for Google Analytics, your configuration should look like this. We have named the trigger as SP-Consent-Google-Analytics
- Click “Save” to create the trigger.
- Repeat the above for each type of plugins, so that you have all triggers created on your GTM.
- Now that you have created your Trigger, you need to attach it to their respective Scripts. Your Next steps will depend on the Plugin for which you are configuring Prior Consent. In this article, we are taking Google Analytics as an example.
- Create the Universal Analytics tag by clicking “New” from the Tags list – or edit your existing Universal Analytics tag.
If creating a new tag, select “Universal Analytics” under the “Choose tag type” pane. Select “New Variable” in the select box under “Google Analytics settings” and enter your GA Tracking ID (available from Google Analytics) in the field “Tracking ID”. Click “Save”.
- As a trigger, select the trigger you have just created, “SP-Consent-Google-Analytics”. Click “Save” to create or update the tag.
This is what your final Universal Analytics tag configuration should look like (except for the Tracking ID):
- Finally, click “Publish” to push your changes live to your site.
Prior Consent for Google Analytics Universal is now enabled on your website.