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
2K members online now
2K 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

Virtual Pageview OnClick event

Follower ✭ ✭ ✭
# 1
Follower ✭ ✭ ✭

How can I generate a Virtual Pageview from the OnClick event?

 

(I know how to generate an EVENT but I'd rather generate a Pageview so I can include it in Goals and such)

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author MrAnalogy
October 2016

Virtual Pageview OnClick event

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi :-)

you would use the following for a virtual pageview

ga('send', 'pageview', 'page path');

Instead of similar to the following for the event tracking

ga('send', 'event', 'category', 'action', 'opt_label', opt_value, {'nonInteraction': 1});

 eta

for example

onclick="ga('send', 'pageview', 'page path');"

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author MrAnalogy
October 2016

Virtual Pageview OnClick event

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi :-)

you would use the following for a virtual pageview

ga('send', 'pageview', 'page path');

Instead of similar to the following for the event tracking

ga('send', 'event', 'category', 'action', 'opt_label', opt_value, {'nonInteraction': 1});

 eta

for example

onclick="ga('send', 'pageview', 'page path');"

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Virtual Pageview OnClick event

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Oh thank God..  someone who posted a simple sample of how to do this for one image..   I did not need to read a thesis on the tag manager to do this..  

Re: Virtual Pageview OnClick event

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi MrAnalogy,

 

You can use Bronwyn ways to send VPV using on page coding approach or you can use the Google Tag Manager. Please check the screenshot below for your reference. The screenshot only shows the Tag part, you have insert trigger by yourself

  

 vpv.jpg