-
Notifications
You must be signed in to change notification settings - Fork 369
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
change: [M3-9159] - Enable Pendo based on OneTrust cookie consent #11564
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
d64b33d
to
0222cae
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty for the instructions to test - super helpful!
✅ performance cookies disabled - confirmed pendo has not loaded (all three methods ✅)
✅ performance cookies enabled - confirmed pendo has loaded (all three methods ✅)
✅ yarn test analytics/utils
some optional nitpicks below
Cloud Manager UI test results🎉 482 passing tests on test run #7 ↗︎
|
Cloud Manager E2E
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
|
Run duration | 30m 09s |
Commit |
|
Committer | Mariah Jacobs |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
4
|
|
2
|
|
0
|
|
488
|
View all changes introduced in this branch ↗︎ |
Description 📝
This PR enables the Pendo analytics script based on the OneTrust cookie consent granted by the user in their cookie preferences. If users disable performance cookies, the Pendo script will not load.
Once we release this change to production, we should be able to change a setting in our Pendo app subscription that has disabled cookies and client side storage use. The Login team needs cookies enabled on our subscription to allow for journey tracking between the anonymous users on Login and Cloud Manager's users.
Note
Confirming one thing with MADS about OneTrust and default opt-ins vs. opt-outs by geolocation (to make sure I don't have to handle anything else here) before I merge.
✅ Confirmed: For non GDPR countries, the user is opted in via OneTrust unless they choose to opt out. For GDPR, they get the option to choose in OneTrust and have to opt in as first time visitor.
Changes 🔄
usePendo.js
hook to check for consent enablement before loading the scriptgetCookie
,checkOptanonConsent
) to handle this inanalytics/utils.ts
analytics/utils.test.ts
Target release date 🗓️
2/11/25
How to test 🧪
Verification steps
(How to verify changes)
Check out this PR and go to http://localhost:3000
Log out of whatever account you're in. At login.linode.com, select Cookie Preferences at the bottom of the screen
Disable the Performance Cookies setting by toggling it off
In your code editor, go to L80 of
usePendo.js
and change the condition forconst hasConsentEnabled = APP_ROOT.includes('localhost')
to add a!
. In this PR, we want to confirm that the OneTrust cookie works locally, but normally we don't want to have to do these steps to enable Pendo for local development.Open the browser dev tools and go to Application > Cookies and view the table of cookies
Find the
![Screenshot 2025-01-24 at 10 45 57 AM](https://private-user-images.githubusercontent.com/114685994/406542418-e2bc7cba-644d-447f-80fc-41f3e3aa44cc.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NTE3NDQsIm5iZiI6MTczOTk1MTQ0NCwicGF0aCI6Ii8xMTQ2ODU5OTQvNDA2NTQyNDE4LWUyYmM3Y2JhLTY0NGQtNDQ3Zi04MGZjLTQxZjNlM2FhNDRjYy5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQwNzUwNDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lOGE1YzNkMjEyMjZiOWM4MjYzMjk5ZmJmNWM5NmY0ZDcwY2Q1NTI2NmRjYWEzYTc4MjcxYTk3YzQzMzlmZWU0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.F9prHVmbGl8qc4dIHD6IhIyq92PIjuR-VKIeB17Mubk)
OptanonConsent
cookie and copy its value to your clipboard. Be sure to uncheck theShow URL decoded
optionAdd a new OptanonConsent cookie for localhost for testing purposes. We can't read cookies with a different domain with
document.cookie
. To add a new cookie, click an empty cell at the bottom of the table. Name itOptanonConsent
and copy the value from the linode.com cookie into the localhostOptanonConsent
cookie.If you want to confirm that OptanonConsent is now being returned in
document.cookie
, use the browser console to log the value fordocument.cookie
.Refresh the page and confirm that Pendo has respected your cookie setting and NOT loaded, which you can do via any of the following:
<head>
tag (it's the script withcontent.psp.cloud.linode.com
)psp.
and confirm there are no requestspendo.validateEnvironment()
and confirm the command failsRepeat the steps above, but with an Enabled Performance Cookie setting to confirm Pendo is loaded and sending data
OptanonConsent
cookie value so thatC0002%3A0
isC0002%3A1
. C0002 is the 'Performance Cookie' group; 0 is disabled, 1 is enabledEnsure tests pass:
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅