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
4.2K members online now
4.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

Retrieve "PageViews"(inside Google Analytics-Reporting--Overview) info in a page using javascript

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Please suggest  Retrieve "PageViews"(inside Google Analytics-Reporting--Overview) info in a page using javascript.

Retrieve "PageViews"(inside Google Analytics-Reporting--Overview) info in a page using javascript

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

Hi,

 

Are you looking to create a report that detects if page elements are loaded with JS? If possible can you please provide some additional details of what you are attempting to do. 

 

Thanks!

Jordan

Retrieve "PageViews"(inside Google Analytics-Reporting--Overview) info in a page using javascript

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Jordan,

 

Thanks for your reply.

I want to query "ga:sessions" info programmatically using Javascript. Please suggest.


Please find Google Analytics Test Account account and Query details below for your reference.


Google Analytics Test Account:

username: gsiprodtest@gmail.com
Password: Password!1


Direct Link to the Report:
https://ga-dev-tools.appspot.com/query-explorer/?ids=ga%3A140192730&start-date=30daysAgo&end-date=ye...


API Query URISmiley SadInclude current access_token in the Query URI (will expire in ~60 minutes). )
https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A140192730&start-date=30daysAgo&end-date=yes...


API QUery ResultSmiley Sadwith JSON file)
{"kind":"analytics#gaData","id":"https://www.googleapis.com/analytics/v3/data/ga?ids=ga:140192730&metrics=ga:sessions&start-date=30da... Web Site Data","tableId":"ga:140192730"},"containsSampledData":false,"columnHeaders":[{"name":"ga:sessions","columnType":"METRIC","dataType":"INTEGER"}],"totalsForAllResults":{"ga:sessions":"19398"},"rows":[["19398"]]}

 

 

Thanks & Regards,

Pokhraj