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

5.7K members online now
5.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

How to set the Page value when sending an event to GA ?

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

I have a Single Page App and sending virtual pageviews through the GA API.


When sending an event, GA is showing the page value in the GA dashboard of the url that was shown in the browser when sending the event. However, that is not the page I want it to send. How can I set the page myself ? Can I use the "document path" value for it? Or differently?


- Ed

Re: How to set the Page value when sending an event to GA ?

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

if you want to send event with different page path setting you have to add some extra parameters to hit:
ga("send", "event", "category", "action", "label", {page: "/my-virtual-page"});

Another way is to set it by using "set" command:
then you can send pageview or event hits and page path will be set to "/my-virtual-page" until you change it again using "set" command.