Tagged: x
-
AuthorPosts
-
January 31, 2017 at 5:52 am #1352130
markusp80ParticipantHi!
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
January 31, 2017 at 7:18 am #1352200
LelyModeratorHello 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/
February 1, 2017 at 3:39 am #1353391
markusp80ParticipantThis reply has been marked as private.February 1, 2017 at 5:26 am #1353501
LelyModeratorHello 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.
February 1, 2017 at 6:00 am #1353538
markusp80ParticipantHmm, 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?
February 1, 2017 at 6:39 am #1353578
Paul RModeratorHi,
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!
February 1, 2017 at 6:53 am #1353592
markusp80ParticipantOk, 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?
February 1, 2017 at 7:31 am #1353633
Paul RModeratorHi,
Yes, it will only trigger on button click and not the succeeded signup.
Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1352130 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
