filipr27

ga4 - slb new - form_submit

Sep 8th, 2022 (edited)
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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': 'form_submit',
  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.  'form_id': '<form_id>',  //ID of the form.
  9.  'form_interest': '<form_interest>',  //The value of the "interested in" field in the form. It is selected from the dropdown menu.
  10.  'region': '<region>'  //Selected region in the contact form "region" field.
  11.  });
  12. </script>
Advertisement
Add Comment
Please, Sign In to add comment