Add my own analytics, Facebook pixel or chat tool to my site
If you already use Google Analytics, Microsoft Clarity, or a chat tool like Intercom, you don’t have to give it up to move to Bernard. In most cases you don’t have to do anything at all - Bernard finds it on your old site and sets it up for you.
The prompt
“Add [Google Analytics / Microsoft Clarity / Plausible / Fathom / HubSpot tracking / Hotjar / the Meta Pixel / Google Ads / Google Tag Manager / Intercom] to my site. My id is [paste it here].”
Signed in, Get my prompt fills in your site for you. Otherwise press Copy and fill in the [bracketed] parts. First time? Connect your AI to bernard once: Use your own AI (opens in a new tab).
If you’re moving from another site
When Bernard moves your site, it reads through your pages and spots any analytics or advertising tools you already have running. If it finds one it can set up - Google Analytics 4, Microsoft Clarity, Plausible, Fathom or the Meta Pixel - it carries the id across and switches it on automatically. Your analytics keeps counting from the moment your moved site goes live, with no gap and nothing to configure.
The carried-over version comes with a cookie banner, so your visitors are asked before it counts them. Google Tag Manager, Google Ads tracking, HubSpot tracking, Hotjar, the older “UA-“ Google Analytics ids and chat tools are not carried over automatically - most of them can be added in one ask (see below), so if you relied on one, give your AI its id.
One case Bernard can miss: a site that only switched its analytics on after a visitor pressed Accept on a cookie banner. There the id is tucked away where the move doesn’t look. So it’s worth checking - ask your AI “What analytics is running on my site?” If the answer is none and you expected some, give it your id and it’s on within a minute. You can change or remove anything that was carried over the same way (see below).
Adding something new
If you want to add analytics that wasn’t on your old site, or you’re starting fresh, tell your AI which tool and give it your id.
How it works
- Say which tool, and give your id. For example: “Add Microsoft Clarity to my site, my project id is 3t0wlogvdz.” Every supported tool has an id like this, shown somewhere in that tool’s own dashboard.
- Your AI checks it looks right and puts it on. If the id doesn’t match
the shape that tool uses, you’ll be told, with where to go and look again
- rather than something broken quietly going live.
- It starts working within about a minute. No approval, no publish button - it isn’t a change to any page, so there’s nothing to review.
What’s supported today
Analytics - Google Analytics 4, Microsoft Clarity, Plausible, Fathom, the HubSpot tracking code and Hotjar.
Advertising - the Meta Pixel, for Facebook and Instagram ads, Google Ads and Google Tag Manager.
Chat - Intercom. More chat tools may be added over time - if you use something else, ask and it’ll be considered.
Why this works differently from everything else
Every other change your AI makes to your site - new text, a new page, a new photo - goes onto a private draft first, and only appears for visitors once you approve it. Working code, on the other hand, is never allowed onto any page at all, draft or live - that’s a safety rule with no exceptions, because a page is the one place a bad script could do real damage.
Analytics and chat tools need working code to function, so they’re handled a different way entirely: you give the tool and the id, and that’s switched on separately from your pages, the same way for every site. Nothing gets pasted in, so there’s nothing for a later edit to accidentally delete either - add a new page next month, and your analytics is already watching it.
Switching or removing one
Changed analytics providers, or moved to a new Clarity project? Ask again with the new id - it replaces the old one, no need to remove it first. Don’t want a tool any more? Ask to remove it, and it’s gone within about a minute.
The Facebook pixel
The Meta Pixel - the thing that tells you whether your Facebook and Instagram ads are actually bringing anyone - can go on your site the same way. Ask for it and give it the number from Meta Events Manager.
It works a little differently from visit counting, because advertising tracking needs your visitors’ permission: the pixel only runs for the ones who agree, so Meta reports fewer people than really visited, and your own visitor counts can step down too. None of that is a fault, but it’s worth understanding before you judge your ad results - Add the Facebook (Meta) pixel so I can tell whether my ads are working walks through the whole thing.
Google Ads
Google Ads goes on the same way. Give your AI the id from your Google tag - it starts with AW- and is followed by digits. Like the Meta Pixel, it is advertising tracking, so it only runs for visitors who agree to advertising cookies, and Google Ads reports fewer people than really visited.
Bernard puts on the Google tag itself, on every page. It does not add a conversion event for one page, because the tag runs everywhere and would count a conversion on every page view. To count conversions, do one of these in Google Ads:
- count a conversion when a visitor reaches a page, such as your thank-you page, or
- import the key events you already track in Google Analytics 4.
Google Tag Manager
Google Tag Manager goes on the same way. Give your AI your container id - it starts with GTM- and you’ll find it at the top of your Tag Manager workspace, next to the container name.
A container can hold any tag, including advertising ones, so bernard treats it as advertising: it only runs for visitors who agree to advertising cookies, and everything inside it waits with it. That means a visit counter inside the container counts fewer people than the same tool added directly. If your container only holds Google Analytics or Google Ads, add those directly instead - they reach more of your visitors.
What goes inside the container is up to you, in Google Tag Manager. Bernard holds the container until a visitor agrees, but it doesn’t see or check the tags you add there. For code of your own on your pages, your AI can propose it for you to approve - see Can I run my own code on my site?.
HubSpot and Hotjar
The HubSpot tracking code tells you which pages your contacts read. Give your AI your HubSpot Hub ID - the account number in HubSpot’s profile menu. If your HubSpot code mentions js-eu1, your account is hosted in Europe, which bernard can’t serve yet - your AI will tell you and pass it on. HubSpot forms are a separate thing - see Connect my website form to HubSpot.
Hotjar shows you where people click and how far they scroll. Give your AI your Hotjar Site ID, the number next to your site in Hotjar. Hotjar is now part of Contentsquare, and the same Hotjar tracking code keeps working.
Both run only for visitors who agree to analytics cookies, once your AI has added them this way. If your old site already had the HubSpot, Hotjar or Tag Manager code, that old copy came across with your pages and does not wait for the cookie banner. Ask your AI to take the old copy out and add the tool again here, then approve the change.
What the Google tags tell Google about consent
On a site with a cookie banner, which is every site running one of these tools, bernard does two things:
- The tags wait. Google Analytics 4 and Google Ads are held inert on the page and only load for a visitor who agrees.
- Consent Mode v2 signals. Before anything else on the page runs, bernard tells Google that analytics storage, ad storage, ad user data and ad personalisation are all denied. When a visitor agrees to analytics, it updates analytics storage to granted. When they agree to advertising, it updates ad storage, ad user data and ad personalisation to granted.
TikTok and LinkedIn tracking still aren’t offered. That’s a question of checking each one properly rather than a rule about advertising - they’ll be added when each has been verified the same way.
For what your visitors are asked and what they see, read How does the cookie banner on my site work?.
Once the numbers are coming in, see how to get useful insights from your visitor numbers.
Questions people ask
- Does Bernard carry over my analytics when it moves my site?
- Yes. If your old site was running Google Analytics 4, Microsoft Clarity, Plausible, Fathom or the Meta Pixel, Bernard detects it during the move and sets it up on your new site automatically. Your analytics keeps counting from the moment the site goes live.
- Will I still see my analytics in my own Google Analytics account?
- Yes. Bernard uses your own id - the G- code from your Google Analytics - so your visits keep going to the same account you already log into, and all your history stays there. Bernard never replaces your account or starts a new one. The one difference to expect: visitors who say no on the cookie banner are not counted, so if your old site never asked, your numbers can be a little lower than before.
- Do I need a developer to add Google Analytics or a chat widget?
- No. Tell your AI which tool you use and give it your id - the number or code the tool gave you when you signed up - and it goes on every page of your site. No code to paste, no file to edit.
- Can I put my Facebook or Instagram ads pixel on my site?
- Yes. Ask for the Meta Pixel and give it the number from Meta Events Manager, and it goes on every page. Two things to know before you look at your results: it only runs for visitors who agree to advertising cookies, so Meta reports fewer people than actually visited - and once visitors are being asked, your ordinary visit counting waits for their answer too, so those numbers can step down as well. Both are what asking properly looks like.
- Which tools are supported?
- Analytics: Google Analytics 4, Microsoft Clarity, Plausible, Fathom, the HubSpot tracking code and Hotjar. Advertising: the Meta Pixel, for Facebook and Instagram ads, Google Ads and Google Tag Manager. Chat: Intercom. That’s the current list - if you use something else, ask and it’ll be considered.
- Can I track Google Ads conversions?
- Yes. Ask for Google Ads and give your AI the AW- id from your Google tag. It goes on every page and only runs for visitors who agree to advertising cookies. Then, in Google Ads, count a conversion when someone reaches a page such as your thank-you page, or import your Google Analytics 4 key events. Bernard puts on the tag itself, not a conversion event for one page.
- Can I use Google Tag Manager?
- Yes. Give your AI your container id - it starts with GTM- and is shown at the top of your Tag Manager workspace. It goes on every page behind your cookie banner, and it only runs for visitors who agree to advertising cookies. That is on purpose: a container can hold any tag, including advertising ones, so it waits for the strictest answer. Everything inside the container waits with it, even a visit counter, so those numbers will be lower than if you added the tool directly. If your container only holds Google Analytics or Google Ads, adding those directly reaches more of your visitors.
- Who looks after the tags inside my Tag Manager container?
- You do, in Google Tag Manager, as before. Bernard puts the container on your site and holds it until a visitor agrees. It does not see or check what you add inside it, so anything you add there runs for visitors who agreed to advertising cookies without passing through bernard.
- Can I add the HubSpot tracking code?
- Yes. Give your AI your HubSpot Hub ID - the account number in HubSpot’s profile menu, or the number in the line of HubSpot’s tracking code that ends in .js. It runs for visitors who agree to analytics cookies. One exception for now: if your HubSpot code mentions js-eu1, your account is hosted in Europe, and bernard can’t serve that version yet - your AI will tell you and pass it on to the bernard team. HubSpot forms are a separate thing and work already (see Connect my website form to HubSpot).
- Does Hotjar wait for consent?
- Yes. Give your AI your Hotjar Site ID - the number next to your site on Hotjar’s Sites & Organizations page. Hotjar only starts recording clicks and scrolling for visitors who agree to analytics cookies, so it sees fewer visits than your site gets. Hotjar is now part of Contentsquare, and the same Hotjar tracking code keeps working, so there is nothing to change.
- Does the Google tag send Consent Mode signals?
- Yes. On every site with a cookie banner, bernard tells Google that all four Consent Mode v2 signals are denied before anything else on the page runs. When a visitor agrees to analytics, it sends analytics storage as granted. When they agree to advertising, it sends ad storage, ad user data and ad personalisation as granted. And the Google tags themselves do not load at all until the visitor agrees.
- Why can’t I just paste the tracking code myself?
- Because a snippet pasted straight into a page is removed, every time - by you, by Bernard or by a connected AI. That’s a safety rule: it’s what stops a stray or malicious script from ever ending up on your site. Analytics and chat tools are added a different, safer way instead - see below - and they only run for visitors who agree to cookies. Code of your own is possible too, but it goes the checked way: bernard checks it and you approve it by publishing (see Run your own code on your site).
- Where do I find my id?
- In the tool’s own dashboard - each one has a settings or setup page that shows it. If you’re not sure where, ask your AI to add the tool and, if what you give it doesn’t look right, it’ll tell you exactly where to look.
- Do I need to publish for it to start working?
- No. It isn’t part of your page - it’s switched on separately, the moment you ask - so it starts working within about a minute, and it’s already there for pages you add later. Nothing to approve, nothing to publish.
- Can I switch to a different account, or take it off?
- Yes to both, any time. Ask to switch to a new id for the same tool and it replaces the old one. Ask to remove a tool and it comes off - your site keeps working exactly as before, just without that one thing counting or watching.