-
Task
-
Resolution: Accepted
-
Should have
-
None
-
3
-
Analytics, Forms
-
Sprint #233, Sprint #234
-
neptune
Summary
One of the challenges with Mixpanel implementation is the need to manage user identification. We have so far relied on Google Analytics which identifies users through their logged-in state on Google accounts, but with Mixpanel we won’t be able to match the same users across devices unless we send them an unique user_id. We have designed a proposal to use hashed emails (from formSubmission events) as the unique user_id. The hashing process and all subsequent steps will be handled by Google Tag Manager, but we need to be able to read the submitted email from the dataLayer.
Requirements
- In all formSubmission dataLayer event sent from Gravity Forms, we need to include a new variable 'userEmail' with the email submitted by the user:
- 'userEmail': 'test@gmail.com' (example)
This needs to be implemented in Gravity Forms.
Resources
- Perhaps the Entry object can be used to retrieve the email? More information here:
- For Hubspot forms we are using an event listener (implemented through Google Tag Manager) to capture the submitted event, take a look at the example below:
<!-- Hubspot Form Event Listener: Form Submission --> <script type="text/javascript"> window.addEventListener("message", function(event) { if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') { window.dataLayer.push({ 'event': 'formSubmission', 'gGoal':'Petition Signup', 'formID': event.data.id, 'formPlugin': 'Hubspot', 'hs-form-guid': event.data.id, 'userEmail': event.data.data.submissionValues.email }); } }); </script> <!-- END Hubspot Form Event Listener: Form Submission -->