Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ga): setup default consent state #71

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion data/google-analytics.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"key": "gtag"
},
{
"code": "window[{{l}}]=window[{{l}}]||[];window['gtag-'+{{l}}]=function (){window[{{l}}].push(arguments);};window['gtag-'+{{l}}]('js',new Date());window['gtag-'+{{l}}]('config',{{id}})",
"code": "window[{{l}}]=window[{{l}}]||[];window['gtag-'+{{l}}]=function (){window[{{l}}].push(arguments);};window['gtag-'+{{l}}]('consent', 'default', {'ad_user_data': 'denied','ad_personalization': 'denied','ad_storage': 'denied','analytics_storage': 'denied','wait_for_update': 500,});window['gtag-'+{{l}}]('js',new Date());window['gtag-'+{{l}}]('config',{{id}})",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern with this is if anyone wants to have different consent options in the future. Instead of hardcoding, what do you think about including consent as optionalParams instead?

Something like:

      //...
      "optionalParams": {
        "l": "dataLayer",
        "consentType": "default",
        "consentValues": {},
      },

CC @flashdesignory @felixarntz

Copy link
Contributor Author

@huang-julien huang-julien Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitively 👍 I think nuxt-scripts shouldn't have any issues with that

"params": ["id"],
"optionalParams": {
"l": "dataLayer"
Expand Down