Skip to content

Commit

Permalink
Merge pull request #9 from haensl/8
Browse files Browse the repository at this point in the history
#8: Add Switzerland to consent region.
  • Loading branch information
haensl authored Jun 14, 2024
2 parents 7742b92 + 8b4ac50 commit 3dc4b5d
Show file tree
Hide file tree
Showing 4 changed files with 616 additions and 654 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.0
* [#8: Add Switzerland to region requiring consent.](https://github.com/haensl/google-analytics/issues/8)
* Update dependencies.

## 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
Loading

0 comments on commit 3dc4b5d

Please sign in to comment.