Skip to main content

For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/plugins/ga-cookies.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/api-reference/llms.txt.

GA Cookies

caution
You are reading documentation for an outdated version. Here's the latest one!

Latest release version badge for the Snowplow JavaScript Tracker

If this plugin is used, the tracker will look for Google Analytics cookies (specifically the “__utma”, “__utmb”, “__utmc”, “__utmv”, “__utmz”, and “_ga” cookies) and combine their values into an event context which gets sent with every event.

Installation​

  • npm install @snowplow/browser-plugin-ga-cookies
  • yarn add @snowplow/browser-plugin-ga-cookies
  • pnpm add @snowplow/browser-plugin-ga-cookies

Initialization​

javascript
import { newTracker, trackPageView } from '@snowplow/browser-tracker';
import { GaCookiesPlugin } from '@snowplow/browser-plugin-ga-cookies';

newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ GaCookiesPlugin() ],
});

Context​

Adding this plugin will automatically capture the following context:

ContextExample
iglu:com.google.analytics/cookies/jsonschema/1-0-0Example GA cookies context JSON showing the _ga cookie value

Was this page helpful?