Google Analytics

21 posts by 8 authors in: Forums > CMS Builder
Last Post: November 6, 2011   (RSS)

By Toledoh - November 1, 2010

Hi Guys.

I want to display some form of web stats within CMSB. I think the easiest thing would be to generate a standard PDF report from Google Analytics via email and use the Email Download Plugin to capture it into the admin.... however one host I work with does not support that plugin. Any other ideas on how I could achieve a similar result?
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Google Analytics

By Damon - November 2, 2010 - edited: November 2, 2010

Hi Tim,

Although this may not be the solution to what you are describing, an alternative option is to display (embed) site stats in the homepage of CMS Builder.

Take a look at the attached screenshot.
[img]http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/Google_Analytics_P84317/gforum.cgi?do=post_attachment;postatt_id=3223;t=search_engine[/img]

I have edited the home page using the free Modify Homepage plugin here:
http://www.interactivetools.com/add-ons/detail.php?Modify-Homepage-1028

Then I added stats widget. It's not Google Analytics but from piwik.org, a php web anylytics you install on the site. I'm not sure what Google Analytics has available for displaying stats content.

In addition to the stats you can also add any other content and links to this page as well.

Hope this gives you some ideas. :)
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Attachments:

modify_homepage.png 159K

Re: [Damon] Google Analytics

By Toledoh - November 2, 2010

How good is that!

Excellent - thanks!
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Google Analytics

By KCMedia - November 4, 2010

Hi Tim

I was thinking the same thing about this the other week as the home page is very plain so i was looking around and found this

http://code.google.com/apis/analytics/docs/articles/gdataAnalyticsCharts.html It will allow you to API google analytics into a page so you should be able to do this within CMS Builder.

Craig
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [Toledoh] Google Analytics

By Rusty - January 4, 2011 - edited: January 4, 2011

And, I've been able to get it to work. Yay.

1) Go to FreshWebTrends (http://freshwebtrends.com/show-off-your-google-analytics-on-your-site/13/) and download the file of your choice. I got the complete summary. http://freshwebtrends.com/downloads/complete_summary.zip
2) Google SWF Object - http://code.google.com/p/swfobject/ and download the latest version of swf_object, AND the swf_object generator. (Perhaps not needed, but this is what eventually helped me to get it working).
3) Unzip the "Complete_summary.zip)
4) Download the "modfiy_homepage.php" plugin
5) Take the "swfobject.js" file, edit it and add the bit of JS that would normally be in the header to the very end of this.
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0");
</script>

Is what I'm talking about.
6) Save the now modified swfobject.js file as custom.js, and upload it to the CMS Admin folder.
7)Go to your Google Analytics click "View Report" to view your dashboard, click the "view report" under Visitor Overview. Now at the top click Export to XML, and save it as "visitor_overview.xml"
8) Place the visitor_overview.xml file in the CMS Admin folder.
9) In your website root folder create a folder called "flash" Upload the "visitors_overview.swf" from the "Complete_summary.zip" file that you downloaded earlier.
10) Unzip and install/open/run the swf_object generator you downloaded earlier. Adjust parameters as necessary, make sure that you put in visitors_overview.swf for the SWF object filename in place of the default "untitled.swf"
11) Click Generate, & Copy to Clip board.
12) Dump the code into the editor of your choice, In my case I already uploaded the swfobject, which I had modified to include the JS to register the swfobject "myFlashContent". So all I needed was the following bit of code

<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent">
<param name="movie" value="visitors_overview.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="visitors_overview.swf" width="800" height="600">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>


I then placed it in my "modify_homepage.php" file, and edited it to reflect the changes earlier.

<!--begin -->
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent">
<param name="movie" value="../flash/visitors_overview.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="../flash/visitors_overview.swf" width="800" height="600">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<!--end -->


[img]http://www.interactivetools.com/forum/gforum.cgi?do=post_attachment;postatt_id=3293;t=search_engine[/img]
Rusty

Re: [Rusty] Google Analytics

By Rusty - January 4, 2011 - edited: January 4, 2011

One other thing I failed to mention, it is possible to setup an automated export of the XML file of your choosing to be mailed to the email address of your choice.

And yes as you can see, there is some weirdness with the Flash SWF file not properly scaling to the amount of visits.

You would also need to create a cron job for the server to ck. server for the presence of a new XML file, and copy it to the admin and replace the xml file that's there. Then the system will be fully automated.

Oh, and sorry that the attached image stretches the screen.
Rusty

Re: [Rusty] Google Analytics

By Toledoh - January 5, 2011

Looks great Rusty - thanks!

I'll have a play, but I expect we could work out something with the Download Email Plugin to get it updating automatically...
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Google Analytics

By Rusty - January 5, 2011

Looks great Rusty - thanks!

I'll have a play, but I expect we could work out something with the Download Email Plugin to get it updating automatically...


Always playing the part of the bookworm, missing the obvious despite it being right in front of me. The email download plugin will save me weeks of development & head-vs-keyboard bashing.

Why didn't I think of that before, I suspect the Email download plugin will do what we need.
Rusty

Re: [Rusty] Google Analytics

By aev - January 5, 2011

What you are doing here looks very interesting!

Maybe you can use the Google Analytics Data Export API instead of email exports?

http://code.google.com/intl/en/apis/analytics/docs/gdata/home.html

-aev-