Install the GeoEngage tag
Where the GeoEngage tag goes, why it has to run before the page paints, and how to find your API key and check it's working.
The tag loads the GeoEngage widget. Once it's on your pages, every rule you publish in the dashboard reaches your site without another deploy.
The tag
<!-- GeoEngage — place in <head>, above your content.
Do not add async/defer: the widget must run before the page paints. -->
<script
src="https://cdn.geoengage.app/ge.js"
data-api-key="YOUR_API_KEY"
data-require-consent="false"
></script>
YOUR_API_KEY is the key of the site the tag belongs to. You'll find it under Sites in the dashboard, with a button that copies the whole tag. Each site has its own key.
The tag records visits only on the website you registered for the site and its subdomains, plus localhost and your local network while you test. Copied onto any other website, it records nothing there. You can change a site's website under Sites.
| Attribute | What it does |
|---|
src | The widget loader. Use it exactly as shown. |
data-api-key | Required. Which of your sites this page belongs to. |
data-require-consent | "true" holds all tracking until the visitor accepts. See Consent mode. |
data-debug | "true" logs what the widget does to the browser console. Leave it out on your live site. |
Where it goes
Inside <head>, above your page content, on every page. Usually that means the one layout or template your pages share.
All three make the widget run after the browser has painted your page. The widget hides the elements a rule is about to change until it has changed them, but it can only do that if it runs first. In our measurements, a tag at the end of <body> showed three frames of the unchanged page; in <head>, none.
The tag itself stays small: it does only what has to happen before the first paint, and loads the rest of the widget in parallel with your page.
Check it's working
- Open a page of your site in a private window. That skips your browser's cache and most blocking extensions.
- View the page source and search for
data-api-key. If it isn't there, the tag wasn't published.
- In the browser console, run
window.GeoEngage?.version. A version number means the widget loaded.
Still nothing? See The tag isn't detected.