Return to Snippet

Revision: 23015
at January 27, 2010 20:24 by davidfrechette


Initial Code
Place this on the page:
<fb:iframe name="_tracker" width="0" src="<your url>" style="visibility:hidden;display:none; width: 0px; height: 0px" frameborder=0/>

Add a proxy for Google, mine is in jsp:
<%@ page import="java.io.*"%><%@ page import="java.net.*"%>
<%
    String strID = request.getParameter( "trackID" );
%>

<head><title>Trackerk</title>
    <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("<your google id>");
        function trackClick(location) 
        { 
            pageTracker._trackPageview(location);
            //alert( location );
        }
        trackClick("<%=strID%>");
    </script>
</head>

Now in flash:
var request:URLRequest = new URLRequest( GetGoogleURL( ) + "&trackID=" + i_ID );
request.method = URLRequestMethod.GET;
navigateToURL( request, "_tracker" );

Initial URL
http://forum.developers.facebook.com/viewtopic.php?id=14243

Initial Description

                                

Initial Title
Tracking with Google Analytics in facebook from flash app

Initial Tags
google, flash, facebook

Initial Language
ActionScript 3