All platforms

Install on Gatsby

The choice is stored on your own domain, so Safari keeps it for its full lifetime, and the regional rules (UK, EU, US) use the visitor's real country.

  1. 1.Route /_tc to the banner

    On your web server (nginx shown; Apache, Express and Caddy work the same way: proxy /_tc/ and pass the visitor's IP). If you cannot change the server, skip this step and use the line below without ?so=1: Safari then keeps the choice for 7 days.

    # In the site's server { } block
    location /_tc/ {
      proxy_pass https://cmp.trackable.digital;
      proxy_ssl_server_name on;
      proxy_set_header Host cmp.trackable.digital;
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header X-TC-Client-IP $remote_addr;
      proxy_set_header Cookie "";
      proxy_set_header Accept-Encoding identity;
    }
  2. 2.Add the banner as the first script in <head>

    In gatsby-ssr.js with setHeadComponents, as the first element. No async or defer.

    <script src="https://cmp.trackable.digital/l/YOUR_SITE_KEY.js?so=1"></script>
  3. 3.Remove the other cookie banner, keep GTM

    Remove any other cookie banner or consent plugin. Keep Google Tag Manager, but make sure the banner script comes before it in <head>, including GTM added by a plugin, a module or a component.

  4. 4.Check it

    Open the site in a private window: the banner shows. Then press Check the site now on the site's Install page in the dashboard, and Scan now on the Cookies page to list its cookies.

Your site key

Replace YOUR_SITE_KEY with your site's key. The dashboard's Install page shows these same steps with it filled in.

Next: Google Tag Manager