Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #400681

    Hi Lads,

    Since I wasn’t “smart enuf” to get event tracking with Analytics to work for a client on Enfold theme – They hired someone else :)
    Fine with me!? ;-(
    Anyway — since we had huge problems with form submissions? It works for admins and shopmanagers (properly all logged in accounts?)
    But when visitors try to submit the form… It randomly for not all fails?
    I was thinking that since tracking is TURNED off for Admins …. Maybe it’s the tracking that makes the built in form fail?
    Could I be barking up the right tree here or should I re-think my theory?
    I did play around with the captcha – No diff
    I did take off validation for some fields – no diff (I am admin so maybe it all works when I do it)

    #401127

    Hi Peter,

    That seems to be, just by looking at the source (not logged) you’ll see two tracking codes (http://screencast.com/t/ilxytFuPjN), can you please create me a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #401359
    This reply has been marked as private.
    #402093

    Hey Peter!

    Can you check if it works now (not logged)? i was unable to find the other GA code source so i removed the Enfold one.

    Best regards,
    Josue

    #402111

    Hi Josue!

    WORKS!! – thanks a million

    Cheers

    Peter

    #402143

    You are welcome Peter, always glad to help :)

    Regards,
    Josue

    #402183
    This reply has been marked as private.
    #402192

    Can you post a link to the page where you have this applied?

    Best regards,
    Josue

    #402266
    This reply has been marked as private.
    #402970

    Hi!

    Use this method instead:
    https://kriesi.at/support/topic/please-clear-this-up-for-em-ga-tracking-2/#post-349057

    You can apply the same class to both Forms so every time the form is submitted it will push an event to GA. I’ve also improved the code so the track fires only when the form submission is valid (no errors).

    Cheers!
    Josue

    #402998

    Hi Josue!

    Thanks … So no edit the “ga” to gaTracker? I am using Yoast?
    and the entire thing in my Child theme is now:

    add_theme_support('avia_template_builder_custom_css');
    
    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	 $('.contact_form_1 input[type="submit"]').on('click', function() {
                 if (!$('.contact_form_1 p').hasClass('error')) {
                       gaTracker('send’, 'event', 'Contact', 'Support Request', 'Contact form');
                 }
             });
        	 $('.contact_form_2 input[type="submit"]').on('click', function() {
                 if (!$('.contact_form_2 p').hasClass('error')) {
                      gaTracker('send’, 'event', 'Contact', 'Support Request', 'Contact form');
                 }
             });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');
    #403040

    Hi!

    Yes that should do it, note if you are using the same class in both forms the code should be changed to:

    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	 $('._CONTACT_FORM_CLASS_HERE_ input[type="submit"]').on('click', function() {
                 if (!$('._CONTACT_FORM_CLASS_HERE_ p').hasClass('error')) {
                       gaTracker('send’, 'event', 'Contact', 'Support Request', 'Contact form');
                 }
             });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Best regards,
    Josue

    #403061

    Hi Josue
    Cool… Well I kind of have to… Because footer form is button 1 on all pages except the contact page then it’s button 2 and contact form is one
    So that make it impossible to differ… Anyway I am happy just to get the tracking to work.
    When I submit the form … and check the anlaytics… NADA shows up?
    Any ideas?

    Peter

    #403065

    There are some unexpected identifiers in the code – http://screencast.com/t/3BiBlduXzApY, try re-writing the quotes in the code in functions.php.

    Cheers!
    Josue

    #403071

    Nice… Spottet!

    Fixed… I will test

    #403083

    Cool, let me know how it goes.

    Regards,
    Josue

    #403446

    Hi Josue,
    Nada … Nothing works… I give up! Avia and GA just will not work together?
    Maybe we will swap to another theme – this is too complicated

    #403576

    Hey!

    The code you’ve put is still using “_CONTACT_FORM_CLASS_HERE_”, you need to replace that with the class of the contact form, try putting the default one “avia_ajax_form”:

    (function($){
        $(window).load(function() {
        	 $('.avia_ajax_form input[type="submit"]').on('click', function() {
                 if (!$('.avia_ajax_form p').hasClass('error')) {
                       gaTracker('send', 'event', 'Kontakt', 'Kunde Form', 'Kontakt form');
                 }
             });
        });
    })(jQuery);

    I know this can be frustrating sometimes but i can assure you that this method works, i’ve tried it myself and also other users whom i recommended it here.

    Best regards,
    Josue

    • This reply was modified 9 years, 10 months ago by Josue.
    #419788

    Hi @Netzie,

    Im just a member here to give you a friendy advice is to get the gravity forms plugin is the best for form submissions.
    Have done extended testing with sun and cross domains with and Google Tag Manger setup and is just 100%.

    Havent hade the pleasure to try it with WPMU yet,

    But Enfold is supportings this plugins with css so far i know.

    I can maby help you out here please read this post.
    https://kriesi.at/support/topic/google-analytics-not-working-in-enfold-2/

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Thinking about analytics… Forms fail’ is closed to new replies.