Analytics
5.4K members online now
5.4K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Virtual page view for alle pages of domain

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

I have to create a virtual pageview (for a funnel) for all pages of one domain. Example:

domain.com/

domain.com/page1

domain.com/page2 etc

should all be included in the same virtual pageview, say, virtual_domain.com. Is that possible?

Thanks!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Moses J
August 2016

Re: Virtual page view for alle pages of domain

Top Contributor
# 2
Top Contributor
Hi Moses,

Is this question is also for the external site from your other question? If so just add the domain name as the value for the search variable and it will fire the same virtual pageview when the referral is the external domain:
var search = "domain.com";
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

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Moses J
August 2016

Re: Virtual page view for alle pages of domain

Top Contributor
# 2
Top Contributor
Hi Moses,

Is this question is also for the external site from your other question? If so just add the domain name as the value for the search variable and it will fire the same virtual pageview when the referral is the external domain:
var search = "domain.com";
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: Virtual page view for alle pages of domain

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks again. Yes, this is for the other question. I didn't want you to bother with a second question that is slightly different. I did exactly what you proposed but wasn't sure if that would work. So, "domain.com" would include all urls from this domain? This would be perfect.

Re: Virtual page view for alle pages of domain

Top Contributor
# 4
Top Contributor
Hi,

Yes, it should include all URLs. You can test it by using actual URLs instead of the referrer in the code:
//var ref1= document.referrer;
var ref1= "http://domain.com/page.html";
You can see if the virtual pageview is fired using the Google Tag Assistant Chrome extension.
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

Re: Virtual page view for alle pages of domain

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
The pageview is perfectly fired with an acutal URL, but not with the document.referrer. Not sure, what's wrong. You can check it here: https://kofferwelt.at/
Thank you very much!

Re: Virtual page view for alle pages of domain

[ Edited ]
Top Contributor
# 6
Top Contributor

Hi,

Please try only the domain name like var search = "geizhals.at";

 

Edit: I used the wrong domain, corrected.


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: Virtual page view for alle pages of domain

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Hi,
thanks a lot. Unfortunately, no luck. I tried "geizhals.at", "/geizhals.at" and "/geizhals.at/". The virtual pageview is still not fired. I'm pretty stuck here.

Re: Virtual page view for alle pages of domain

Top Contributor
# 8
Top Contributor
Hi,

It's weird, I just tested it on my own domains and using only the domain name like "geizhals.at" works.

It is recommended to put your GA tracking code before the closing head tag instead of the footer, I'm not sure if it would make a difference though.

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: Virtual page view for alle pages of domain

[ Edited ]
Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Hi,
I put the tracking code in the header. Still no luck. The referring page creates a link like this:

https://geizhals.at/redir.cgi?h=kofferwelt-at&loc=https%3A%2F%2Fkofferwelt.at%2FHersteller%2FSamsoni...

The query contains a redirection for the tracking of the clicks. Could that be the problem? However, if I hard code this URL for test purposes it does work. I checked the referrer with this snippet:

 

var referrer = document.referrer;
alert(referrer);
window.location=referrer;


The referrer is empty. It works perfectly if the referring link does not contain a query.

Re: Virtual page view for alle pages of domain

Top Contributor
# 10
Top Contributor
Hi,

Did you try if it works with a simple query string like ?h=test for eg?

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