greenpeace / planet4

Built on top of Wordpress tech, Greenpeace Planet 4 powers digital platforms to engage with millions and win campaigns around the world.
https://planet4.greenpeace.org
Creative Commons Attribution Share Alike 4.0 International
64 stars 26 forks source link

Generate an email hash on formSubmission events and set it in dataLayer/Cookie #189

Closed stduerre closed 18 hours ago

stduerre commented 1 month ago

Brief summary of task:

On form submissions (GravityForms), generate an email hash. The hash needs to be base64 encoded SHA256 and the output needs to be the same as gp_user_id in this function: https://gist.github.com/stduerre/f98ed2cd4ac540da1c3389b674a64b90

The generated hash needs to be used in two ways:

Consent to set the cookie can be determined like this:

analytics_storage is granted in Google Consent Mode V2 at the time when the cookie should be saved

To ensure full compatibility with different countries' privacy law, the default value for analytics_storage also needs to be set in Planet4 settings. At the moment, the default is always denied, but some countries don't need active consent for analytics data and would benefit from being able to set the default to granted (even before an interaction with the cookie block happens)

Objectives of task:

Only use the hashed email for analytics user tracking for improved privacy.

Relevant documentation:

Current hashing function: https://gist.github.com/stduerre/f98ed2cd4ac540da1c3389b674a64b90

Other resources:

No response

Estimated length of task:

No response

Timeline for task:

No response

Dependencies on other work:

No response

Example of similar work:

No response

Help:

No response

comzeradd commented 18 hours ago

Fixed at https://github.com/greenpeace/planet4-master-theme/pull/2308