Add function setConsent() to set end user consent state for web apps in Firebase Analytics#6376
Add function setConsent() to set end user consent state for web apps in Firebase Analytics#6376dwyfrequency merged 13 commits intomasterfrom
Conversation
🦋 Changeset detectedLatest commit: 0d0bd61 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (347,240 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
Adding API docs into local branch
|
|
||
| /* eslint-enable camelcase */ | ||
|
|
||
| /** Whether a particular consent type has been granted or denied. */ |
There was a problem hiding this comment.
You can ask @egilmorez for a more definitive opinion but I guess maybe "should be" instead of "has been" since in this context we can only set it, not read the current state. Also needs a @public tag.
| [key: string]: unknown; | ||
| } | ||
|
|
||
| /** Maps the applicable end user consent state. */ |
There was a problem hiding this comment.
Suggest: "Consent status settings for each consent type." or similar, @egilmorez may have suggestions. Also add @public tag.
egilmorez
left a comment
There was a problem hiding this comment.
Doc strings LGTM, thanks!
| ad_storage?: ConsentStatusString; | ||
| // Enables storage, such as cookies, related to analytics (for example, visit duration) | ||
| analytics_storage?: ConsentStatusString; | ||
| // Enables storage that supports the functionality of the website or app such as language settings |
There was a problem hiding this comment.
Looking at the generated analytics.api.md, it looks like api-documenter still thinks these are undocumented. I think api-documenter may need comments to be in the /** */ format.
| * Use the {@link ConsentSettings} to specify individual consent type values. By default consent | ||
| * types are set to "granted". | ||
| * @public | ||
| * @param consentSettings Maps the applicable end user consent state for gtag.js. |
There was a problem hiding this comment.
Oops, I just ran build on this branch and noticed warnings from api-documenter that consentSettings needs to be followed by a hyphen here, and also customParams on line 236, which I think was from a previous PR.
hsubox76
left a comment
There was a problem hiding this comment.
LGTM, just address the param tsdoc comment before merging.
Sets the applicable end user consent state for this web app across all gtag references once Firebase Analytics is initialized.