Google analytics in flash

From Edgar BV Wiki
Jump to navigation Jump to search

Dit zet je op de eerste frame van je movie:

/// GOOGLE ANALYTICS SIMPLE TRACKING /// Script by: corban baxter

import flash.external.ExternalInterface;

function gaTracking(page) {

taal = 'nld'; if (_root.taalkeuze._currentframe==1) { taal = 'nld'; }else{ taal = 'eng'; }

ExternalInterface.call("pageTracker._trackPageview", '/flash/'+taal+'/1024/'+page); }

//end

Dit onder een knop:

on (press) { /// GOOGLE ANALYTICS SIMPLE TRACKING /// Script by: corban baxter

import flash.external.ExternalInterface;

function gaTracking(page) {

taal = 'nld'; if (_root.taalkeuze._currentframe == 1) { taal = 'nld'; } else { taal = 'eng'; } ExternalInterface.call("pageTracker._trackPageview",'/flash/'+taal+'/1024/'+page); } //end }

on (release) { gaTracking("keuze/nederlands");//sends event to google's analytics system _root.play(); _root.taalkeuze.gotoAndStop(1); }

en dit in je html pagina:

<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-7449145-1"); pageTracker._trackPageview(); } catch(err) {}</script>

Voor Meer info over analytics in flash:

[1]