0
votes

I'm trying to set up Google Analytics on my web site to record views each page gets. On the site, users can upload items and they get their own pages for their items.

My questions are,

Can you use google analytic snippet with a unique page ID on each page and later grab the results (total page views) for a given page ID using google analytics API?

As my findings I could use this, source

ga('send', 'pageview', 'pageid-00001'); //can you retrieve results using GA api based on page id(pageid-00001) ?

or source

_gaq.push(['_trackEvent', 'pageid-00001']); //can you retrieve results using GA api based on page id (pageid-00001) ?

Later, If I need to launch a revenue sharing program based on page views recorded by google analytics, is it secure to use google analatics? I mean is it possible someone else place my GA snippet on another page( cheap advertising pages) and gain page views?

1

1 Answers

0
votes

First off you are mixing tracking codes.

ga('send', 'pageview', 'pageid-00001'); is Universal analytics

_gaq.push(['_trackEvent', 'pageid-00001']); is Classic analytics

Google analytics already tracks pages. Go to:

Behavior -> Site Content

The reports under there all list what pages where hit.

You can could still add your page id: If your using universal analytics you could create a custom dimension for page id. In Classic analytics I think you would need to create a custom Variable.