SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //Push this dataLayer event when the user clicks to save a content piece on a magazine post page. |
| 1 | + | //Push this dataLayer event when a user successfully submits a form. (Do not fire the event again if the user revisits the thank-you page.) |
| 2 | ||
| 3 | <script> | |
| 4 | window.dataLayer = window.dataLayer || []; | |
| 5 | window.dataLayer.push({
| |
| 6 | - | 'event': 'content_save', |
| 6 | + | 'event': 'form_submit', |
| 7 | - | 'page_section': 'enjoyed this article?', //Section of the page where the event happened. |
| 7 | + | 'form_name': 'speak with sales', //Name of the form. (For the contact form, it can be selected from the "Tell us what you'd like to do" dropdown menu.) |
| 8 | - | 'title': 'methane and flare emissions. a fixable problem', //The title of the content piece. |
| 8 | + | 'form_id': '<form_id>', //ID of the form. |
| 9 | - | 'content_type': 'article', //The type of content. |
| 9 | + | 'form_interest': '<form_interest>', //The value of the "interested in" field in the form. It is selected from the dropdown menu. |
| 10 | - | 'content_category': 'decarbonizing, new energy', //Category that the content piece belongs to. If multiple, separate names by a comma. |
| 10 | + | 'region': '<region>' //Selected region in the contact form "region" field. |
| 11 | - | 'content_group': 'magazine', //The content group that the content piece belongs to. |
| 11 | + | |
| 12 | - | 'ui_element_name': '<ui_element_name>', // The name of the UI element from the Zeplin file. |
| 12 | + |