-
Task
-
Resolution: Done
-
Must have
-
10
-
Block: EN Form
-
Sprint #74
This is related to Gabor's ticket: *https://jira.greenpeace.org/browse/PLANET-2836*
- As a web editor, I want to insert values on the Form Backend so that I can better identify conversions on Analytics.
- As a data analyst, I want to start tracking the signups on the Planet 4 pages and be able to identify what kind of conversion or campaign the form is related to.
Part 1: Create text or dropdown fields on the Form Backend
The values chosen by the user will be sent through dataLayer.push method
- Campaign name [dropdown field with this list
- Basket name [dropdown field with this list
- Scope [dropdown field with this list
- Department [text field]
Part 2: Send a dataLayer event with parameters defined on the backend:
Embed an onclick dataLayer.push in the submit button code that will send an event and parameters (values) the were input by the user:
dataLayer.push({
'event' : 'petitionSignup'
'gcampaign' : ‘[value defined in Campaign field]’,
'gBasket' : ‘[value defined in Basket field]’,
'gScope': ‘[value defined in Scope field]’,
'gDepartment': ‘[value defined in Department field]’,
});
This would automatically collect the "submit" event, and send it to Google Analytics using the GTM configuration.