AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
3.7K members online now
3.7K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Tracking inline form errors/ Virtual Page Views

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi All,

 

I'm looking to add some event tracking to capture inline errors on one of our application forms. I have done this previously when tracking links using the onClick command, do I need to use a different command for the code below as there are no clcik event listeners when the error fires

 

ga(‘send’,’event’,’Consumer App’,’Form Error’,’Invalid Postcode’,{‘nonInteraction’: true})

 

The form itself is built on one page but I would like to fire virtual page views at certain break points. Would it just be a case of adding to the code where you want the page view to be fired?

 

Thanks,

 

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Christopher D
September 2016

Re: Tracking inline form errors/ Virtual Page Views

Top Contributor
# 4
Top Contributor
Hi Christopher,

You need to set the page and send the pageview separately if you are sending the form error events from the page so they will be sent with the correct page value. Please check the document below:

https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#modifying_page_urls

Let me know if you have more questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Re: Tracking inline form errors/ Virtual Page Views

Top Contributor
# 2
Top Contributor
Hi,

Your event tracking code is OK for tracking the errors, you just need to add it to the command which fires the error.

In order to track certain breakpoints as virtual pageviews you need to detect when the part you want to track becomes visible (using js or jQuery) and fire a virtual pageview:

ga('set', 'page', '/virtual-page.html');
ga('send', 'pageview');

Let me know if you have questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Tracking inline form errors/ Virtual Page Views

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks for the response Arnold.

For the virtual page view, could I add in the following code:

ga('send', { 'hitType': 'pageview', 'page': '/step 2')

or do I need to set the page and send the pageview separately?

Marked as Best Answer.
Solution
Accepted by topic author Christopher D
September 2016

Re: Tracking inline form errors/ Virtual Page Views

Top Contributor
# 4
Top Contributor
Hi Christopher,

You need to set the page and send the pageview separately if you are sending the form error events from the page so they will be sent with the correct page value. Please check the document below:

https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#modifying_page_urls

Let me know if you have more questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital