Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1352130
    markusp80
    Participant

    Hi!

    I have built a landing page where the visitor can sign up for a free webinar. I have used the Email Forms extension and connected to a Mailchimp account.

    Now I would like to send information to Analytics for measuring sign ups and to be able to connect the information in the UTM-codes in the links they clicked to get to the landing page, with the actual sign ups, the conversions.

    This could easily be done if I could just insert my code for a virtual pageview on the right place in the code, for example whener the thank you-message is shown. That way we know that a user successfully has signed up and we can count that as a conversion. A goal would then be set up in Analytics as a pageview for the virtual URL that gets sent to Analytics every time the thank you-message is shown.

    The code for sending a virtual pageview in Analytics looks like this:
    ga(‘send’, { ‘hitType’: ‘pageview’, ‘page’: ‘/my-virtual-url-here’ });

    This is what I want to be able to insert in the right place, like just before or after the thank you-message is shown. I have done this before and put this code in a js-file which gets called when a user signs up on a website. This is better than counting button clicks, for example. More reliable data.

    Is this possible? To get to the code for the Email Form extension? I could connect via FTP and insert it if that’s possible, you just have to tell me where this code is that gets called when a user pushes the button.

    Ask me if anything is unclear.

    /Markus

    #1352200
    Lely
    Moderator

    Hello Markus,

    We can insert that using a child theme. To help you better, please do give us the specific page where you want to implement. You may also check this article for guidance:https://community.theme.co/kb/customization/actions-and-filters-in-x/

    #1353391
    markusp80
    Participant
    This reply has been marked as private.
    #1353501
    Lely
    Moderator

    Hello There,

    We can use Javascript instead. Please add the following code on Appearance > Customize > Custom > Edit Global Javascript:

    jQuery('form#x-subscribe-form-251 .submit.x-btn').on( 'click', function(){
    ga('send', { 'hitType': 'pageview', 'page': '/webinar-17-feb-2017-signup-succeeded' });
    } );

    It should be added on the submit button and not on thank you message because the click event it what will trigger it.

    Hope this helps.

    #1353538
    markusp80
    Participant

    Hmm, but I’m not sure that will be relevant. A user could fill in the form incorrectly, press the button, get an error message and then leave the page. And it would still count as a conversion if the buttonclick event is what triggers the virtual pageview.

    Wouldn’t it be possible to call this function when the thank you-message is shown? Or does it have to be a click event that triggers it?

    #1353578
    Paul R
    Moderator

    Hi,

    Regretfully it could only be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding. Take care!

    #1353592
    markusp80
    Participant

    Ok, yes I could check with our developers about that.

    But in the meantime I could try using the code you wrote above, but I would have to keep in mind that there’s the buttonclick and not the succeeded signup that triggers the conversion, right?

    #1353633
    Paul R
    Moderator

    Hi,

    Yes, it will only trigger on button click and not the succeeded signup.

    Thanks

  • <script> jQuery(function($){ $("#no-reply-1352130 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>