views:

70

answers:

2

Hello all,

Im completely new to Flash and ActionScript2 but what I need is to add Google analytics code to track clicks from "button"

Bellow is a part of my function

this.onRelease = function(){
    getURL("http://www.mysite.co.uk/someulr.html","_self");
    getURL("javascript:pageTracker._trackPageview('/flash_site.html');","_self");
}

Because there are two links browser on click opens two windows. how can I prevent from this. I obviously need to open just someurl.html

Thank you for your help in advanvce

A: 

if you can upgrade to as3 then there is a library built by google

http://code.google.com/p/gaforflash/

otherwise this blog post may help

http://blog.circlecube.com/2008/01/28/integrate-google-analytics-with-flash-tutorial/

Josh
Thats the thing, I cant! Which is annoying
Dom
+1  A: 

You could create a generic javascript funcion that would take care of registering the user's click to google and then open the appropriate webpage. I named the function '_trackPageviewAndNavigateTo':

getURL("javascript:pageTracker._trackPageviewAndNavigateTo('/flash_site.html', 'http://www.mysite.co.uk/someulr.html');","_self")
jdecuyper