1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Form Submission tracking - Tag Manager/ Google Analytics

Discussion in 'Free Divi Community Forum' started by RobertaCin, May 20, 2020.

  1. RobertaCin

    RobertaCin Member

    Hello Divi Helpers,

    I would like to track contact form submission using events in Google Tag Manager, in order to set up events and goals in Google Analytics.
    The issue is that DIVI doesn't have Form ID, neither visible element class when the form is submitted.

    The tutorial I followed is this one:

    After seeing these solution cannot be applied I found that the only solutions available could be just the following but they are quite technical so wondering if you have maybe any suggestion.
    https://support.google.com/tagmanager/thread/31434288?hl=en
    https://www.bbccss.com/form-tracking.html

    Thank you!
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade logo carousel design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    What about the first method, set a redirection to the thank you page after submission?
     
  3. RobertaCin

    RobertaCin Member

    Could you kindly recommend any method to set the thank you page redirection in DIVI? online tutorial I mean, video or post. Thanks
     
    1. PRO MEMBER PERKS Divi.Help Header AI Generator - Try the power of AI to generate a custom Divi header for you:Try Now
  4. Divi.Help

    Divi.Help Administrator
    Staff Member

    You just need to create a new page for the thank you page & go to the Contact Form Module Settings & set the redirect URL (see screenshot below):

    upload_2020-5-22_16-48-41.png
     
    RobertaCin likes this.
  5. RobertaCin

    RobertaCin Member

    thank you. I will try
     
    1. PRO MEMBER PERKS Divi Ultimate Blog Plugin - Easily set awesome default design for your Divi single blog page:Learn More
  6. Bazinga

    Bazinga New Member
    Divi Powerful Child Theme Divi Ultimate Archive Plugin Divi Ultimate Blog Plugin Divi Ultimate Header Plugin Divi Ultimate Footer Plugin

    The problem I find with tracking "thank you" pages, is they produce inaccurate results.

    Here's what I've found:

    User 'A' submits a form and lands on a "thank you" page. They leave the site from the "thank you" page, then return later by typing the URL into the browser. The browser auto-completes the last address they viewed on the site and the user lands back on the "thank you" page recording a (false) form submission event.

    User 'B' for whatever reason decides to refresh the "thank you" page using F5 and another (false) form submission event is recorded.

    User 'C' hits the form "Submit" button but leaves the site before the "thank you" page has time to load the analytics script and the "thank you" page view is never counted.


    I've tested this by tracking form submissions and by counting "thank you" page views. They are usually different.


    In response to the OP's original query, I track Divi form submissions using the following GTM configuration:

    1. Enable GTM's built-in Form variables
    2. Create a Form Trigger using the trigger type "Form Submission"
    3. Set the trigger to fire on "Some Forms"
    4. Fire the trigger when the following conditions are true: Form Classes > Contains > et_pb_contact_form
    5. Create a Tag with the following configuration:

    Track Type = Event
    Category = Form Submit (or whatever you want to call it)
    Action = Contact Us (or whatever you want to call it)
    Label = {{Page Path}} (so you know what page the form was sent from)
    Analytics Settings = (your tracking code)

    This works well but there is one problem that I haven't yet been able to overcome, it tracks form submissions even if the form has not been successfully sent due to "required fields" not being completed.

    There is an option in the GTM trigger type to "Check Validation", however the Divi form doesn't present any usable variable that identifies a 'successful' form submission.

    I'll let you know if I find a solution to this.
     
    pud likes this.
  7. Hibigibi

    Hibigibi New Member

    What if you used the "Success Message" field as a variable that identifies a "successful" form submission?

    upload_2021-8-20_21-22-53.png
     
    pud and Speed Fire like this.
    1. PRO MEMBER PERKS Divi Block Pro - Premade floating button design for your Divi site without using any plugins:View Demo
  8. pud

    pud New Member

    Hey @Bazinga did you find a solution
     
  9. pud

    pud New Member

    Hi @Hibigibi this would be the best solution but I don't think this works, I'm no expert in GTM but I have looked at numerus guides online that use event listeners but the problem is that none of the classes or ID's change when the message is sent, so unless I'm missing something or this is another way?
     
    1. PRO MEMBER PERKS Divi Block Pro - Powerful Divi header builder for you to mix & match premade header design, mobile menu & more:Learn More
  10. kuba.wtf

    kuba.wtf New Member

    I solved this with a plugin I created for a friend using the Divi theme. It's awaiting publication in the WordPress plugin directory but the code is open-source and you can see it on Github: https://github.com/zizzfizzix/tracking-for-divi. If you want the installable file here's the link: https://github.com/zizzfizzix/tracking-for-divi/releases/download/v0.1.0/tracking-for-divi.zip download it to your computer and upload it to your WordPress instance.
     
    pud likes this.
  11. pud

    pud New Member

    Hey Awesome thanks, I've just tested it and it works, for those testing it took around 24 hours for GA4 to register a form start and submit, not sure why it takes this long as other data is near instant, this is a GA4 issue though nothing to do with the plugin.

    When do you think it will the WordPress plugin directory, and can you let me know when it is please?
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade testimonial carousel design for your Divi site without using any plugins:View Demo
  12. kuba.wtf

    kuba.wtf New Member

    Looks like it will be around 2 months, at least that's the notice they currently give when uploading. I'll post a link here when it's available. In the meantime, you can star the GitHub repo and get notifications when there are updates.
     
    pud likes this.
  13. pud

    pud New Member

    Great thanks, quick question does this only fire if the message successful message appears?
     
    1. PRO MEMBER PERKS Divi Block Pro - Easy-to-use drag & drop interface to mix & match 456+ premade Divi blocks & export as json file:Learn More
  14. Bangers&Mash

    Bangers&Mash New Member

    Hey the simple option is to just address the issue of the form not having an ID by putting an ID on the form. You can add this code in your integrations tab in Divi Options:


    HTML:
    <script>
    jQuery(document).ready(function(){
       jQuery('.et_pb_contact_form').attr('id', 'divi_contact_form');
    });
    </script>
    You can change 'divi_contact_form' to any ID you want
     
  15. kuba.wtf

    kuba.wtf New Member

    In short, yes. It's looking for an indicator of an error in the server response, if it's not there it will fire.
    I have just released a new version (see https://github.com/zizzfizzix/tracking-for-divi/releases) with some customization options and the ability to send events and conversions to Google Analytics and Google Ads. No breaking changes, the default settings are still the same.
     
    1. PRO MEMBER PERKS Divi Ultimate Header Plugin - Add custom vertical navigation for your Divi site. Turns into slide in menu on mobile:Learn More
  16. Will Munroe

    Will Munroe New Member

    This plugin looks awesome! Was it every released? Will it need to be updated for the current version of Wordpress?