Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
Invalid source URL for Google Analytics
  • Loading branch information
bulzgkri authored and bulzgkri committed Dec 15, 2014
1 parent 24af3b4 commit 4be8b27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SlmGoogleAnalytics/View/Helper/Script/Gajs.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ public function getCode()
protected function getLoadScript()
{
$script = 'google-analytics.com/ga.js';
$httpsOrHttp = "'https://ssl.' : 'http://www.'";
$scheme = "'https://ssl.' : 'http://www.'";
if (true === $this->tracker->getEnableDisplayAdvertising()) {
$script = 'stats.g.doubleclick.net/dc.js';
$httpsOrHttp = "'https://' : 'http://'";
$scheme = "'https://' : 'http://'";
}

return <<<SCRIPT
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? $httpsOrHttp) + '$script';
ga.src = ('https:' == document.location.protocol ? $scheme) + '$script';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();\n
SCRIPT;
Expand Down

0 comments on commit 4be8b27

Please sign in to comment.