Site Tools‎ > ‎Tips and Tricks‎ > ‎

Google Analytics: How to post information on your most active Site pages in your Google Site.

Google Analytics offers a wealth of information to Google Site owners. It would be nice if you could post some of that information for others to see. There is a Google Analytics API that lets you do that. Saqib Ali has created a script that lets you post the information on the pages within your site with the most hits (hopefully, this will encourage others to create similar scripts for other Google Analytics data).

Here's the directions on using the script:

Step 1) Create a page on a Google Site where you want to display the data.

Step 2) Add the script (attached below) to your Google Site .

Step 3) In the script you will need to modify two variables/parameters, the id (line 21) and the statsInterval (line 22).  The statsInterval is just how many days of data that you want to display. In my example below, I asked to display the pages with the most activity for the last 100 days.




How to determine your id:  
3a-1) Go to http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html
3a-2) Click on the Authenticate with Google Analytics button.

3a-3) You should see a message that says A third party service is requesting permission to access your Google account. You may/may not see the sign-in screen. If you do, click on the Sign in with a Google Apps Account link, otherwise, just skip to the next step. Once you click on the Sign in with a Google Apps Account link, fill in your email address and leave you password blank and click Sign in.

3a-4) Click on Grant access.

3a-5) Click where it says click to list your accounts.

3a-6) Now you should see a list of any Site that you have had set up in Google Analytics. If you have multiple sites, you will see them on the drop down as shown below. It is the value in the ids field (ga.xxxxxxx) that you will need for your script.


Step 4) Save your changes to the script.

Step 5) Embed the Google script in the page you created in Step 1

That's it! 

ċ
GA_TopHits_Script.txt
(3k)
rosemary.arce@seagate.com,
Mar 26, 2012, 11:27 AM
Comments