-
-
// Track 404 pages. Replace your GA tracking code (http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=86927):
-
<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-xxxxx-x”);
-
pageTracker._trackPageview(“/404.html?page=” + document.location.pathname + document.location.search + “&from=” + document.referrer);
-
</script>
-
//————————————————————————-
-
// Classify your site visitors (http://www.google.com/support/analytics/bin/answer.py?answer=57045&ctx=sibling)
-
<script type=“text/javascript”>pageTracker._setVar(‘Marketing’);</script>
-
//————————————————————————-
-
// Track your (outgoing) links/ads banner or downloads (http://www.google.com/support/analytics/bin/answer.py?answer=55526)
-
<a href=“http://www.example.com” onClick=“javascript: pageTracker._trackPageview(‘/outgoing/example.com’);”>
-
// For flash ads for example:
-
on(release) {
-
getURL(“javascript: pageTracker._trackPageview
-
(‘/bannerads/advertisername/bannername’);”);
-
getURL(“http://www.advertisersite.com”);
-
}
-
-
This little trick allows a Flash movie (swf) to find out the URL of the page in which it’s embedded. Javascript must be enabled for this to work. if the window.location.href.toString method doesn’t return a value then ExternalInterface.call will return null. Same thing happens when Javascript is disabled.
-
// This little trick allows a Flash movie (swf) to find out the URL of the page in which it’s embedded.
-
import flash.external.ExternalInterface;
-
var pageURL:String =
-
ExternalInterface.call(‘window.location.href.toString’);
-
-
-
function replace(str:String,find:String,replace:String):String
-
{
-
var index:Number;
-
while(str.indexOf(find)!=-1)
-
{
-
index= str.indexOf(find);
-
str = str.substr(0,index) + replace + str.substr(index + find.length);
-
}
-
return str;
-
}
“flash” related tags
spirit’s tags
-