Visitor consent, analytics, and third-party scripts
Set up the consent entry point and verify collection after accepting or declining.
You set up analytics for a client, but a new browser shows different results from a colleague’s. Check three things separately: the site’s policy, where the active theme places the consent control, and what this visitor actually chose. Together they determine whether a prompt appears and whether analytics is permitted.
Configure the policy and theme control
- Open the site’s consent settings (
/cms/sites?view=consent). Select an accessible consent policy page, attach a cookie policy if needed, and set the retention period. - Check the consent section in the active theme’s shared layout. The full theme places it in the layout’s layers slot. Its heading, explanation, and buttons are theme content. Review them in each supported language.
- Open a normal public URL and check the prompt and policy links. The editor’s “Show in preview” setting applies to the canvas. The live site follows the actual visitor decision.
The resolved region, policy, and saved choice determine collection. A policy change advances its version, and a visitor with an earlier choice may need to choose again. Record the hostname and locale for each run so the results are comparable.
Check what happens after accepting or declining
| Test | What to do | What to look for |
|---|---|---|
| First visit | Open the page in a fresh browser context | Where a prompt is expected, check that it appears and its policy link opens |
| Accept analytics | Accept where analytics is offered, then open another public article | Check the collection requests and reporting that follow |
| Decline analytics | Use a different fresh browser context, decline, and revisit the page | Check the requests and collection behavior for the declined visit |
| Policy update | Change the policy or version on a test site, then revisit using a browser with a saved choice | Confirm that readers are prompted again when the new version calls for it |
An HTTP success response alone does not prove an event was counted. Check collection settings, the visitor’s choice, the reporting window, and whether the request was a preview.
Manage third-party scripts
Create an injection in the admin (/cms/injections) for the site or a specific domain and choose its required consent purposes. The rule applies to the whole record. Verify whether the script loads after accepting and after declining. An injection excluded on the initial response may become available on the next page request after the visitor consents.
Valid editor previews omit third-party injections. Use an ordinary public URL for verification. For interpreting search clicks, visits, and conversions, continue with site analytics.