Google Analytics Reporting API TOS and Caching - google-analytics

I have a client website with Google Analytics installed. The client would like to have a carousel widget of sorts created that will appear in the header area on all the pages of the website. This widget will display the top 10 most visited pages on the website for a given timeframe.
I'm looking to create a Google API authentication piece on the backend of the website and setup the necessary Google Analytics Reporting API call to obtain the required info. My thought was that this call could be made once daily or weekly and the results saved so that the widget could access this information as required without having to make a new API request each time.
This seems like a reasonable setup but I'm unclear if this will violate Google API's TOS.
https://developers.google.com/terms
The TOS reads ...
e. Prohibitions on Content
Unless expressly permitted by the content owner or by applicable law, you will not, and will not permit your end users or others acting on your behalf to, do the following with content returned from the APIs:
Scrape, build databases, or otherwise create permanent copies of such content, or keep cached copies longer than permitted by the cache header;
With the above in mind, who is the content owner that I would need to get permission from? Is my client the content owner of their analytics data or is Google?

Is my client the content owner of their analytics data or is Google?
Your client is owner of their Google analytics data.

Related

Gathering data from google analitycs to my own admin panel

I'm starting with google analitycs.
Before I'll start implementing this into my pages I'm wondering if I'm able to get informations like average time at site, where my user came from, which devices they are using etc.
I would like to get those information from my VueJS front SPA application by async HTTP GET call and display those there. Is it possible?
If yes I would be very thankful if you provide some links to google API where I can find it or some tutorial.
Since Universal GA you can't access users' origin data outside GA in your application. Before that you had all this juicy information inside a cookie, inside __utma, __utmz etc (more info here).
The information you're asking about (time on site, pages visited, etc) can be retrieved from GA afterwards if you make use of the userid feature.

Can I push page data into marketo manually

We have a site built where our customers come to buy some digital content. But most of the clients use the digital content for marketing campaigns. And employ marketo and many other automation products to track leads.
We have a custom built web analytics tool for our site,which is not robust enough. But our clients just want to know if any leads visited our website and push this event to marketo or any other marketing automation tool. I was wondering if there is a way to read the marketo cookie and send a very simple "site visited" data to marketo so that the client is aware that the prospective lead has read the digital content they brought from us? Does this require a marketo API Key?
We also want to achieve this without embedding any Marketo Munckin codes in our digital content.
Can this be generalized to include other marketing tools?
If you want to get analytic info on how many visitor reached specific target page, you can use Google Analytics in your site and define targets. It will not identify which lead visited. For that you must implement Munchkin Cookie of Marketo.
I think the way this worked for me .
The idea here is to get a unique Marketo-id from client and use just Munchkin.init to register a 'page visited' for that client , who might have filled a landing page data earlier.
And then goahead and read the marketo cookie for that browser as mentioned in their blog here.
http://developers.marketo.com/blog/get-a-visitors-cookie-id-and-then-query-associated-lead-data/
This data can also be pushed from backend server with hardcoded script for marketo. This way you can control what data you can send to Marketo and also correlate the user uniquely from Marketo.

Allowing user access to analytics

I would like to enable (some) of my users to view my website's analytics data.
Our website has a bunch of groups where users can add content. I would like to enable certain users (group admins), to view usage statistics for that specific group. Ofcourse the data should only be accessable to those users with the VIEW_ANALYTICS right, not to any others.
Is there any way to do this in Google Analytics, or is there some other platform I could use to easily achieve this goal (we use AWS for our hosting)?
Regards,
klmdb
The Google Embed API allows you to display analytics data in your own pages. Pages that are only accessible to the members of your VIEW_ANALYTICS group.
You can create a service account and give it the appropriate access in the analytics user management for the property.
You also authorize the service account to use the embed API in the developers API console. (I don't have enough points to include more than two links in an answer.) In the API console you can generate a private key (p12 or json format) which you then use on your server to authenticate the request for analytics data.
You don't say which technologies you are using, but they show Java and Python examples of how to set up the authentication by the Service Account. I've also seen some node.js and php libraries.
This way you don't have to manage who has access through the google anayltics admin system, you just need to control who has access to your "dashboard" page.
I have done this all with client-side javascript and it works. Of course the client-side nature means that anybody who knows how to use browser debug tools can get our private-key, but in our particular case I'm not worried about it. On the other had it seem like you need to keep some security around this so I wouldn't recommend the client-side solution.

Displaying Analytics Dashboard for Clients using Google Analytics

We have certain amount of clients and each of us will have their pages on our website. We have to show them the analytics for their particular page. For this, we have the data on Google Analytics according to pages.
On the client admin page, they should be able to view the analytics for their page. This has to be coming from Google Analytics.
I have tried using the Core Reporting Api, but that needs an authentication and one should have access to Google Analytics profile, which is not possible for clients.
So now, Is there a way, where the client can see the dashboard with data being pulled form Google Analytics without any authentication?
No, authentication is required to pull data directly from Google. You could use one 'global' Google account and keep that account authenticated through code so that your users can access that data.
Only other option I've seen is to automate the export of the CSV data (via email) and have a routine that pulls off the CSV data and imports it into a system for public/private use - such as in your example.
Hope this helps!

Google analytics api

I would like to have a div on my companies website that is filled with links to our most-visited pages dynamically by querying our google analytics account. From everything I've been looking at in the DataExport API though, it seems like the user viewing the site has to authenticate. Am I missing something?
This is correct: google analytics only supplies exported data to an authenticated user (you wouldn't want it otherwise after all, with your competitors peeking at your data, right?-).
You can run the application querying analytics separately, with all required authentication, and have that application supply such data selectively to "your company's website" with whatever level of validation you think is warranted (to avoid snooping competitors) -- if the exact subset of data that you supply (just most-visited pages, for example) is not sensitive according to your judgment, you may in fact get away without the "validation" part!-).
You could add a server side script that grabs your analytics data using the api and write some javascript that inserts it into the div.
There are a number of different client libraries for google analytics you could use.

Resources