Direct to sGTM, Testing
(Data Flow version without using GTM Web Container) (Part 3 of 3)
Testing your Usercentrics Cookie Value¶
GTM Preview Mode
In this step you are using the Preview option from Google Tag Manager to check the value of the cookie received from the Usercentrics sGTM server.
We will first check the tags triggered and the cookie value with the visitor consenting to send data to Google Analytics and then with the visitor not consenting to send data.
Go to Google Tag Manager.
Return to your "Server Container"
We are now going to be testing our "Server Container" Click on the "Preview" button.
The "Preview" mode¶
Clicking on the Preview button will open a new page, the "Preview" mode of your Server Container
Keep both this Preview Mode and the regular GTM pages open
Notice:
- On the left of the page, look at the area under "Summary 🗑"
- Note that the space is empty.
- We will soon see activity there, proving that data is arriving at the Preview of your SST Server.
In another tab, go to your site and click randomly and scroll
Activity¶
Get Back to Google Tag Manager "Summary 🗑" page, you will see some activity, select page view
Click on Request
Click "Incoming HTTP Request"
Under "Cookie" - locate "ucConsentAllowedDps" In this ucConsentAllowedDps
cookie, we can see which consent values this visitor (you right now) agreed to in the Usercentrics CMP. We will use this to help the SST Server determine which data is allowed to be collected.
Click on Tags
Successfully fired Tag, based on Trigger¶
Google Analytics tag was fired because it matches the condition in the trigger
Under "Summary," click trash button to clear data
Go to your site in the other tab and click "Privacy Settings"
Toggle User Consent¶
Click slider to deactivate "Google Analytics"
Click "Save Settings"
Click "Refresh" and click randomly and scroll
Click on page_view event again
Click on Tags
Successfully respected user consent, tag not fired¶
Because Google Analytics was disable by the visitor, we see this Tag is under "Tags Not Fired"
In conclusion, this means that we have both:
- Properly setup our sGTM Server container to receive data from the browser and send it to Google Analytics, and
- As the Usercentrics sGTM Server is integrated together with the Usercentrics CMP, it respects the visitors consent choices and handles data appropriately.