Embed analytics/tracking code in Instant Messenger

If you want to embed your tracking code (e.g. Google Analytics) you need to set up an url which includes your tracking code and pass this url to the toksta implementation code as the parameter own_url. This url will be called once the Instant Messenger is loaded.

This Example will call the url http://www.your-domain.com/toksta_analytics.html once the IM is loaded

<script type="text/javascript"> 
  var TOKSTA_CONFIG = { 
    app_id: "your-application-id", 
    user_id: "the-user-id", 
    user_hash: "the-user-hash", 
    user_data: "the-user-data", 
    generated: "current-unix-timestamp", 
 
    //adjustments needed
    own_url: "http://www.your-domain.com/keep_online.php",
    own_url: 60
    //------
  }; 
</script> 
<script src="http://embed.toksta.com/embed/toksta.js" type="text/javascript"></script>

The File http://www.your-domain.com/toksta_analytics.html just contains the analytics code and could look like this Example

<html>
<head>
</head>
<body>
<!--Example for Google Analytics Code -->
<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">
try {
var pageTracker = _gat._getTracker("UA-...");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
 
embed_analytics_tracking_code_in_instant_messenger.txt · Last modified: 2009/06/28 17:47 by mg
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki