Archive for November 22nd, 2013

Recently Google allow to track at Google Analytics Display Advertising to see demographics and interest of visitors. Althought google removed keywords information from analytics, now this is an interesting and very useful info to help us to make new marketing strategies

You need to do a simple line change at your google analytics Tracking Code:

<script type="text/javascript">// <![CDATA[
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-xxxxx-y']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script');

ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

 

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

// ]]></script>

change the line in bold by

<script type="text/javascript">// <![CDATA[
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-xxxxx-y']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script');

ga.src = (‘https:’ == document.location.protocol ? ‘https://’ : ‘http://’) + ‘stats.g.doubleclick.net/dc.js’;

var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s); })();

// ]]></script>

You can also generate an updated basic code snippet that includes the change by going to Admin > property > Tracking Info, and turning on the Display Advertiser Support option.

If you are using wordpress plugin Google Analytics for WordPress (version 4.3.3)

go directory:

wp-content/plugins/google-analytics-for-wordpress/frontend

Edit file class-frontend.php and change this line number 300 of code:

300 echo “(‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytic s.com/” . $script . “‘”;

and changed to:

300 echo “(‘https:’ == document.location.protocol ? ‘https://’ : ‘http://’) + ‘stats.g.doubleclick.net/” . $script . “‘ “;

if you are using simple Simple Google Analytics

Go to directory wp-content/plugins/simple-google-analytics/class

Edit file Output.class.php and change line 142:

142 $ret .= ‘ga.src = (\’https:\’ == document.location.protocol ? \’https://ssl\’ : \’http://www\’) + \’.google-analytics.com/ga.js\’;’ . “\n” ;

change by this:

142 $ret .= ‘(\’https:\’ == document.location.protocol ? \’https://\’ : \’http://\’) + \’stats.g.doubleclick.net/dc.js\’;’ . “\n” ;

Its very simple change but if you need help let me know commenting this post

 

5 Comments so far. Join the Conversation