Skip to main content

GA Cookies

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

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

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-0