Submitting details.
Please wait ...


Tracking virtual page views with analytics.js

11th, June 2014

Virtual pages are commonly used, for example, to record successful form submissions when your site does not have a static "thank you" page. Tracking with the previous _ga.js_ was as simple as inserting the following (example) line of code -


- upon a succesful form submission. But how about the new _analytics.js_ ? With only some minor adjustments, the above code will now look like -

ga('send', 'pageview', '/thank-you')

For further reading on this, and the other changes from ga.js to analytics.js, you can visit the Google Developers' Google Analytics Reference at

-- Riz

quick search