SHOW:
|
|
- or go back to the newest paste.
| 1 | - | // Fire this dataLayer event when a successful submission of the newsletter sign-up form occurs. The event should fire only for successful submissions. The event shouldn't fire again if the user reloads or revisits the thank-you page. |
| 1 | + | // Fire this dataLayer event when a successful submission of a form occurs. The event should fire only for successful submissions. The event shouldn't fire again if the user reloads or revisits the thank-you page. |
| 2 | ||
| 3 | <script> | |
| 4 | window.dataLayer = window.dataLayer || []; | |
| 5 | window.dataLayer.push({
| |
| 6 | - | 'event': 'newsletter_sign_up', |
| 6 | + | 'event': 'form_engagement', |
| 7 | - | 'formLocation': 'pop_up', // Variable value - the location of the form on the page, e.g. footer, body, pop_up |
| 7 | + | 'formAction': 'Submission', |
| 8 | - | 'timeOnSite': '5-10min', // Time user spent on the site (across all of their sessions) before subscribing. Categorized into 5-minute ranges. |
| 8 | + | 'formCategory': 'Contact Sales', |
| 9 | - | 'popUpShows': '2' // Specifies which time they subscribed: the first time the pop-up shows, the second time (>24h after the first pop-up), or the third time (>2weeks later). Include only for pop-up subscriptions. |
| 9 | + | 'formName': 'AI in Delfi', // Variable value, based on which product/service the form is for. |
| 10 | 'formId': '123', // Variable value - the ID of the form. | |
| 11 | - | </script> |
| 11 | + | 'formInterest': 'Digital Infrastructure' // Variable value based on what user selects from the Subject Of Interest dropdown. |
| 12 | }); | |
| 13 | </script> | |
| 14 | ||
| 15 |