This guide shows you how to make GA Connector work properly with CookieYes. The goal is simple: the GA Connector script should only run after a visitor accepts analytics cookies, never before. We’ll also make sure its cookies are categorized correctly so your banner and cookie policy stay accurate.

Before you start

You’ll need:

  • A CookieYes account with the banner already installed in the <head>, before your other scripts.
  • Access to edit your site’s HTML (or your GTM container).

Step 1: Check which integration type you’re using

GA Connector comes in two integration types, and the script you need is different for each. Confirm which one your site uses by following How to Check Which GA Connector Integration Type You’re Using.

The quick version: view your page source, search for gaconnector.js, and look at the subdomain. tc. or tracker. means Cookie-Based; ta. or track. means API-Based.

Then follow the matching script below.

Running both integrations?

If your page source contains both a cookie-based subdomain (tc. or tracker.) and an API-based one (ta. or track.), you’re running both integrations in parallel. This is fully supported — just make sure you replace both scripts using the two sections below.

Step 2: Load GA Connector after consent

Both scripts below wait for CookieYes and load GA Connector only once the visitor accepts analytics cookies. Place your chosen script on every page, below the CookieYes banner script, and leave the code as-is.

Don’t reload the page on consent.

Turn off any CookieYes (or theme/plugin) setting that reloads or redirects the page the moment consent is given, because a reload might break the attribution.

If you use the Cookie-Based integration

Use this script:

If you use the API-Based integration

The API-based version doesn’t use hidden fields, so the script is shorter. Use this script, and replace YOUR_ACCOUNT_ID at the top with your own GA Connector account ID:

Set your account ID.

The API-based script won’t track anything until you replace YOUR_ACCOUNT_ID with your actual GA Connector account ID. Leaving the placeholder in means no data is sent.

Adding the script through Google Tag Manager

If you’d rather manage the script in GTM, add it as a Custom HTML tag with the script for your integration type. Set the trigger to All Pages (All Pageviews), and turn off any consent checks or consent-based triggers on the tag.

Don’t add a second consent gate in GTM.

The script already waits for CookieYes consent on its own. If you also add a consent check or consent-based trigger to the GTM tag, the two gates will conflict and the script won’t load. Trigger on All Pages and let the script handle consent.

Step 3: Categorize the GA Connector cookies in CookieYes

So your banner and cookie policy describe GA Connector correctly, re-scan your site in the CookieYes dashboard (Cookie Manager, then scan). Once the scan finishes, make sure every cookie starting with the gaconnector_ prefix is categorized as Analytics. Move any that landed under Uncategorized into the Analytics category, then publish your changes.

Checking that it works

  1. Open your site in a private window, or clear all cookies first.
  2. Open your browser’s developer tools, go to the Application tab, and find Cookies.
  3. Before you accept the banner, confirm no gaconnector cookies are present.
  4. Accept analytics, reload, and confirm GA Connector loads. For the cookie-based integration, you should now see the gaconnector cookies and your form’s hidden fields populated.
  5. If you want to be thorough, decline analytics in a fresh session and confirm nothing loads.

Still stuck?

If GA Connector isn’t capturing data after consent, or the cookies aren’t behaving the way you expect, contact our support team and include the page where the scripts are installed so we can take a look.