Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/browser-plugin-ga-cookies",
"comment": "Change default from UA to GA4",
"type": "none"
}
],
"packageName": "@snowplow/browser-plugin-ga-cookies"
}
16 changes: 8 additions & 8 deletions plugins/browser-plugin-ga-cookies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

Browser Plugin to be used with `@snowplow/browser-tracker`.

Adds Universal Analytics and Google Analytics 4 cookies to your Snowplow tracking.
Adds Google Analytics 4 and optionally Universal Analytics cookies to your Snowplow tracking.

## Maintainer quick start

Part of the Snowplow JavaScript Tracker monorepo.
Build with [Node.js](https://nodejs.org/en/) (14 or 16) and [Rush](https://rushjs.io/).
Part of the Snowplow JavaScript Tracker monorepo.
Build with [Node.js](https://nodejs.org/en/) (18+) and [Rush](https://rushjs.io/).

### Setup repository

```bash
npm install -g @microsoft/rush
npm install -g @microsoft/rush
git clone https://github.com/snowplow/snowplow-javascript-tracker.git
rush update
```
Expand All @@ -40,14 +40,14 @@ newTracker('sp1', '{{collector}}', { plugins: [ GaCookiesPlugin(
/* pluginOptions */
) ] });

/*
/*
* Available plugin options `GACookiesPluginOptions`:
* {
* ua: Send Universal Analytics specific cookie values. Defaults to true.
* ga4: Send Google Analytics 4 specific cookie values. Defaults to false.
* ua: Send Universal Analytics specific cookie values. Defaults to false.
* ga4: Send Google Analytics 4 specific cookie values. Defaults to true.
* ga4MeasurementId: Measurement id/ids to search the Google Analytics 4 session cookie. Can be a single measurement id as a string or an array of measurement id strings. The cookie has the form of <cookie_prefix>_ga_<container-id> where <container-id> is the data stream container id and <cookie_prefix> is the optional cookie_prefix option of the gtag.js tracker.
* cookiePrefix: Cookie prefix set on the Google Analytics 4 cookies using the cookie_prefix option of the gtag.js tracker.
* }
* }
*/
```

Expand Down
4 changes: 2 additions & 2 deletions plugins/browser-plugin-ga-cookies/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ interface GACookiesPluginOptions {
}

const defaultPluginOptions: GACookiesPluginOptions = {
ua: true,
ga4: false,
ua: false,
ga4: true,
ga4MeasurementId: '',
cookiePrefix: [],
};
Expand Down