486/5000
Hello. I use a Google Analytics code on my sites on the thank you page after submitting a form. However, in Canvas, it displays a message on the form itself. Is it possible for me to put this code somewhere to count the form submissions of a site without needing the thank-you page for the submission? It would be great to just view the message and Google count as form submission. I thank you all.
Google Analytics on the Form
4 replies · opened Dec 8, 2017
Hello,
This is surely possible but you will need to make some JS changes. Find the following code in the js/functions.js File inside the contactForm: function() Function Block:
if( data.alert != 'error' ) { $(form).clearForm(); }and replace it with:
if( data.alert != 'error' ) { $(form).clearForm(); }
_gaq.push(['_trackPageview', '/some-page']);
You can change the /some-page in the above code to whatever you would like to call your page.
This should definitely work fine. Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Great, this will help me a lot. But, if in that case, I do not want to call any other page. Let it just display the success message and send the signal to Google Analytics? I leave the '/ some-page' blank? Thanks!
Hello,
The above code will not navigate the page but will just register a Page View on Google Analytics with an identifier: /some-page . So, you can change this to something simple so that it is easy to remember like: /contact-form-success .
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Thank you, so much!
Have the same question, or something new?
Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.
Reply on the dashboard