This guide shows how to install the Blue Tracely snippet with Google Tag Manager (GTM): as a Custom HTML tag that fires on every page. If you can edit your site's header directly, that works just as well. See Installing Your Blue Tracely Tracking Script.
Before you begin
- Cookie consent tools. Many consent tools hold GTM tags back until the visitor consents. Decide how the Blue Tracely tag should follow your consent tool before you publish. See How to configure Google Tag Manager to fire the Blue Tracely tag only after consent is given.
- Content Security Policy. Your site's policy applies to scripts that GTM adds too. If your site has one, it must allow the Blue Tracely script. See Troubleshooting: Check for Content Security Policies (CSP) Issues.
- Sites that change pages without reloading. The script reports one page view per full page load. A GTM trigger that fires on route changes doesn't add page views, because the snippet does nothing when the script is already on the page. See Single Page vs. Multi-Page Sites: A Data Collection Perspective.
Step 1: Copy your snippet
- On the Script page, select Install next to your domain.
- Select Google Tag Manager. The Install with Google Tag Manager steps open with your snippet below them.
- Select Copy.

Step 2: Create the tag in Google Tag Manager
- In Tag Manager, open the container for your website.
- Choose Tags, then New.
- Choose Custom HTML as the tag type.
- Paste your snippet into the HTML field, unchanged.
- Give the tag a name you'll recognize, such as "Blue Tracely".
For details on Custom HTML tags, see Google's Custom tags help page.
Step 3: Set the trigger
- Without a consent tool: set the trigger to All Pages, so the tag fires on every page.
- With a consent tool: set up the trigger your consent approach needs, as described in How to configure Google Tag Manager to fire the Blue Tracely tag only after consent is given. If your site uses CookieYes, the script reads the visitor's choice itself. See Using CookieYes Cookie Consent with Blue Tracely.
Save the tag.
Step 4: Submit and publish
- Select Submit in your workspace.
- Name the version so you can find it later.
- Select Publish.
The tag only reaches your site once the container is published.
Step 5: Check the installation
Open your site, then go back to the Script page and select Test script next to your domain. When the script answers, you'll see "The script is installed on your website." See Verifying Your Script Installation.
Things to keep in mind
- Fire it early. A trigger that fires late, or only on some pages, means fewer visitors are identified. See The Impact of Script Placement on Profile Collection Efficiency.
- Fire it once per page. Don't add the snippet in GTM and in your site's code at the same time.
- Consent is yours to manage. Apart from following CookieYes, the script doesn't read consent tools. See Impact of Cookie Acceptance Policies on Tracking Script Performance.
Common issues
- The tag never fires. Your consent tool may be holding it back, or the container isn't published. GTM's preview mode shows whether the tag fired.
- The script loads in preview but not on your live site. Check that the latest container version is published, and look for blocked-script errors in your browser's console.