brijeshb42 brijeshb42 - 2 months ago 5
Javascript Question

How to send pageview for one subdomain from some other subdomain

Suppose I have a blogging system where each category has its own subdomain like

python.blog.com, javascript.blog.com
.

python.blog.com
lists all posts of python in an infinite list and I am sending pageviews for each article when it comes into view.

But once in a while, when the user is on
python.blog.com
, I pull in some articles from
javascript.blog.com
as related article and show it in the list between articles on
python.blog.com
. Now I want to send the pageview of article retrieved from
javascript.blog.com
from
python.blog.com
.

How would I do that in Google Analytics ?

Answer

If this makes sense for you it should work by setting the location field.

ga('send','pageview', { 'location' : 'http://javascript.blog.com/path/to/article' });