# Page Tracking with Google Analytics in AS3?

**URL:** <https://forum.kirupa.com/t/page-tracking-with-google-analytics-in-as3/293903>\
**Category:** flash\
**Created:** [August 5, 2009, 4:28pm UTC](https://forum.kirupa.com/t/page-tracking-with-google-analytics-in-as3/293903 "2009-08-05T16:28:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rawtiger](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@rawtiger](https://forum.kirupa.com/u/rawtiger)\
**Post date:** [August 5, 2009, 4:28pm UTC](https://forum.kirupa.com/t/page-tracking-with-google-analytics-in-as3/293903/1 "2009-08-05T16:28:43Z")

</div>

Page Tracking with Google Analytics in AS3?

Hello…

I have been asked to put some of the above into a flash site. I haven’t really come across this before and was wondering if anyone knew anything about it?

There are a couple of articles online - one on google’s own site - but I can’t find any AS3 examples - or much about it at all for that matter.

Here are the articles I’ve been pointed to in order to get it done.  
[http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55520](http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55520)  
[http://blog.circlecube.com/2008/10/03/event-tracking-with-google-analytics-flash-integration-tutorial/](http://blog.circlecube.com/2008/10/03/event-tracking-with-google-analytics-flash-integration-tutorial/)

and here’s how I’ve re-written the code for AS3 - the corresponding javascript code is in the html file.

```auto
var testLink1:URLRequest = new URLRequest("javascript:pageTracker._trackPageview('/folder/file.html');");

testButton_mc.addEventListener(MouseEvent.CLICK, trackLink1);

function trackLink1(event:MouseEvent):void
{
    navigateToURL(testLink1);
}

```

Has anyone had any experience with this before??

Thanks a lot for any help - it’s much appreciated!
