A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: google.com/analytics - With Flash? Will it work for each page?

  1. #1
    Member
    Join Date
    Feb 2007
    Posts
    39

    google.com/analytics - With Flash? Will it work for each page?

    I built a website entirely in flash, so its one single .swf file. Is there a way I can post the code that google analytics gives me on each keyframe, in the .fla file, so it can be tracked that way, instead of just on the .html page?

    They say to put it right above your </body> tag.

    Here is the code google analytics gave me.

    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-3538877-1");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>
    I need to find this out ASAP, so any help would be great.

    Thanks in advance.

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    You would use ExternalInterface to call the tracking code javascript function. I'm not sure what it is off the top of my hand, but I've done it. You'd call that function, and pass the string to track as a parameter.

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center