Tagged: , , ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1432228

    Hi, I have created a trigger in GTM. If a form submission is done on the path /wordpress/ the trigger is fired. This trigger is not fired though.

    My setup is pretty straight forward:

    • Connected Tag Manager with the Google Site Kit
    • Linked GA4 to GTM
    • Created a Form Submission trigger based on Page Path from the page /wordpress/
    • Enable Catcha V3 with fallback to V2, enabled both API credentials
    • Do receive the email from contact form and the sent receipts

    What am I missing?
    GTM Trigger Form Submission

    • This topic was modified 10 months, 3 weeks ago by envis.
    • This topic was modified 10 months, 3 weeks ago by envis.
    #1432296

    Hey envis,
    Is your screenshot from your Google Site Kit plugin? I am not familiar this this plugin or this screen. Try checking the plugin documentation or asking their support, perhap the plugin is looking for a specific class to be clicked? Or perhaps it doesn’t track logged in users?
    When I check your contact form it gives the success message and I don’t see any error in the browser console, so it doesn’t seem to be a javascript error.
    Typically the gtag function that I have seen people use is like this from their documentation

    function gtag_report_conversion(url) {
         var callback = function () {
         if (typeof(url) != 'undefined') {
          window.location = url;
        }
      };
      gtag('event', 'conversion', {
          'send_to': 'TAG_ID/CONVERSION_LABEL',
          'value': 1.0,
          'currency': 'USD',
         'event_callback': callback
      });
    return false;
    }

    and on the same documentation page it has examples for on-click triggers, this is a jQuery example for a form plugin button:

    (function($) {
        setTimeout(function(){
    $('#top.page-id-120 #nf-field-29').click(function() {
        gtag_report_conversion('https://your-site.com/client-sign-up/');
    	console.log('gtag_conversion_triggered');
    });
    },900);
    }(jQuery)); 

    Best regards,
    Mike

    #1432929

    The screenshot was of Google Tag Manager (GTM). I really want to use the GTM solution for form submit measuring. Apparently the built in “Form Submission” trigger, does not fire with the Enfold Form, since there is no page reload on submit. A solution would be if I catch the response of the form submission by CSS id in GTM. 2 Problems with this:

    Thank you message code (div id) is very generic
    The code is not very unique <div id="ajaxresponse_1" class="ajaxresponse ajaxresponse_1" style="display: block;"><div id="result_ajax_response_1" class="ajaxresponse ajaxresponse_1"><h3 class="avia-form-success ">Jouw bericht is verstuurd!</h3></div></div> but I can fix this with a Page Patch criterium in GTM.

    Message stays in screen
    The “thank you message” stays in the screen, so if the user accidentily opens the /contact/ page again, the trigger is fired twice and the submits are counted twice as well. Can this be avoided?
    <img src="<img src=”https://i.ibb.co/qsc6cmm/2024-02-04-16-01-13-Clipboard.png&#8221; alt=”2024-02-04-16-01-13-Clipboard” border=”0″ />” alt=”Thank you message” />Thank you message

    • This reply was modified 10 months, 2 weeks ago by envis.
    • This reply was modified 10 months, 2 weeks ago by envis.
    • This reply was modified 10 months, 2 weeks ago by envis.
    • This reply was modified 10 months, 2 weeks ago by envis.
    #1432944

    Hi,
    The ID result_ajax_response_1 is only in the page DOM after the contact form is submited and won’t be there on the page load.
    Note that this is inside on the ajaxresponse_1 ID, and on page load ajaxresponse_1 is empty.
    I’m not sure what your options are with Page Patch criterium in GTM but perhaps you can also get the page ID so you will know what page it is.
    You could also add a custom field to your pages which could be added to the body classes for better information than the page ID, see this thread for an example.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.