: Google Analytics Goals with AJAX Functionality? I have some nice ajax contact/enquiry forms etc on a website I'm working on which are working great (and degrade gracefully). I'd like to make
I have some nice ajax contact/enquiry forms etc on a website I'm working on which are working great (and degrade gracefully).
I'd like to make use of Google Analytic's 'Goals' feature. The trouble is, the only way I can see this could work for my form is if it redirected to another page (be it a thank-you page or similar) after submission, then I can enter that url at a page people only visit after they've submitted my form. I can see how this would work for my non-JS visitors (if any even have it disabled!), but is there any way to track when an AJAX form has been submitted?
Thanks
Edit: I should add that I know I can work out manually the conversion rate and so on/so forth by the number of enquiries I receive, but why not try and make things easier for mysef? :-)
More posts by @Hamm4606531
1 Comments
Sorted by latest first Latest Oldest Best
You could use Google Analytics' functionality to log a pageview for non-existent page URL when your form is submitted. This fake URL can then be used in your goal.
The code for logging a fake pageview is as follows:
_gaq.push(['_trackPageview', '/fake/page/url'])
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.