Skip to content

Commit

Permalink
Add Switzerland and United Kingdom to consent region.
Browse files Browse the repository at this point in the history
  • Loading branch information
haensl committed Jun 14, 2024
1 parent 7742b92 commit 9dea7c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.2.0
* [#8: Add Switzerland to region requiring consent.](https://github.com/haensl/google-analytics/issues/8)

## 1.1.1
* [#10: Fix `ga` stub.](https://github.com/haensl/google-analytics/issues/10)

Expand Down
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const regionEU = [
'SE' // Sweden
];

export const regionConsent = [
'CH', // Switzerland
'UK' // United Kingdom
] + regionEU;

export const install = () => {
if (platform.hasWindow) {
if (!window.dataLayer) {
Expand Down Expand Up @@ -69,7 +74,7 @@ export const init = ({
window.gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
region: regionEU
region: regionConsent
});

consent(trackingConsent);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@haensl/google-analytics",
"version": "1.1.1",
"version": "1.2.0",
"description": "Google Analytics 4 service abstraction for gtag and measurement protocol.",
"module": "index.js",
"type": "module",
Expand Down

0 comments on commit 9dea7c4

Please sign in to comment.