Skip to content

Commit

Permalink
Item1142: with proper quoting, this time
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/GoogleAnalyticsPlugin@2701 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
WillNorris authored and WillNorris committed Feb 25, 2009
1 parent 7ee38d9 commit f7bce54
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/Foswiki/Plugins/GoogleAnalyticsPlugin.pm
Expand Up @@ -33,22 +33,22 @@ sub initPlugin {
################################################################################

sub _addToHead {
my $header = '<!-- Google Analytics script -->
my $header = q|<!-- Google Analytics script -->
<script type="text/javascript">
// <![CDATA[
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"));
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("'.$googleSiteKey.'");
pageTracker._trackPageview();
} catch(err) {}
try {
var pageTracker = _gat._getTracker("|.$googleSiteKey.q|");
pageTracker._trackPageview();
} catch(err) {}
// ]]>
</script>
';
Foswiki::Func::addToHEAD('GOOGLEANALYTICSPLUGIN',$header)
}
</script>|;

Foswiki::Func::addToHEAD('GOOGLEANALYTICSPLUGIN',$header)
}

################################################################################
1;

0 comments on commit f7bce54

Please sign in to comment.