Advertising and analytics tags
Insights can load a website's Google Analytics 4, Google Ads, Microsoft Advertising (UET) and Microsoft Clarity tags for you, so one install snippet and one consent choice cover them all. Each tag loads only after the visitor agrees to its kind of cookies.
Add a website's tags
- In the menu, open Insights, then Sites and apps.
- On the website's card, open Advertising and analytics tags.
- Type the ID of each tag you use. You find them in each service:
- Google Analytics 4 measurement ID, such as G-ABC123XYZ9: in Google Analytics, Admin, Data streams.
- Microsoft Clarity project ID, such as k3t0wlogvd: in Clarity, Settings, Overview.
- Google Ads ID, such as AW-123456789: in Google Ads, Goals, Conversions, Tag setup.
- Microsoft Advertising UET tag ID, such as 187000123: in Microsoft Advertising, Tools, UET tag.
- Select Save tags. The website picks the change up within a few minutes.
- Ask whoever looks after the website to remove the same tags from the site's own code, so they do not load twice.
Only IDs are accepted, never a script or an address: Insights loads each tag from its service's own address. The IDs are not secret; anyone can see them in the website's pages.
Which consent loads which tag
- Analytics: Google Analytics 4 and Microsoft Clarity.
- Advertising: Google Ads and Microsoft Advertising UET.
Before a visitor chooses, and after they say no, none of these tags loads and nothing is sent to Google or Microsoft. If a visitor changes their mind later, each tag already on the page is told straight away (Google Analytics stops sending); it is gone from the next page on. Visitors whose browser sends Global Privacy Control or Do Not Track count as having said no, so no tag loads unless they agree themselves under Cookie settings.
Tags load only on a website that asks visitors: one that shows the ASTRO cookie banner or follows the site's own consent tool. A website set to count visits without cookies never asks, so its tags never load; the card says so.
Conversions
Under Conversions, list the moments that count, such as a sign-up or a demo request. Use the name of a button marked
with data-insights (for example <button data-insights="signup">) or of an insights.track() event.
When one happens, Insights also tells the tags that are on: Google Analytics and Clarity get an event, Microsoft Advertising gets a custom
event, and, when you add its Google Ads label (the part after the slash in AW-123456789/AbC-D_efG-h12), Google Ads gets a
conversion. The screen shows the event name the tags receive: spaces and other signs become underscores, so "Book a demo" is
Book_a_demo.
Websites with a Content Security Policy
If the website sends a Content Security Policy, whoever looks after it adds the services' addresses for the tags you use, next to the Insights addresses it already allows:
- Google Analytics 4:
script-src https://www.googletagmanager.com;connect-src https://www.googletagmanager.com https://*.google-analytics.com https://*.analytics.google.com;img-src https://www.googletagmanager.com https://*.google-analytics.com. - Google Ads:
script-src https://www.googletagmanager.com https://www.googleadservices.com https://www.google.com;connect-srcandimg-src https://www.googleadservices.com https://googleads.g.doubleclick.net https://www.google.com https://pagead2.googlesyndication.com;frame-src https://www.googletagmanager.com. Google lists the full set, including your country's Google address, in its guide to using the Google tag with a Content Security Policy. - Microsoft Advertising UET:
script-src,connect-srcandimg-src https://bat.bing.com. - Microsoft Clarity:
script-src https://www.clarity.ms https://*.clarity.ms;connect-srcandimg-src https://*.clarity.ms https://c.bing.com.
None of the tags needs 'unsafe-inline' or 'unsafe-eval': Insights adds them as ordinary script files.