Skip to content

Commit

Permalink
Merge pull request duilio#58 from mortada/master
Browse files Browse the repository at this point in the history
add support for google analytics display features
  • Loading branch information
duilio committed Jan 3, 2015
2 parents 7792e32 + 25322ee commit 1c0cb84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions templates/_includes/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{{GOOGLE_UNIVERSAL_ANALYTICS}}', '{{GOOGLE_UNIVERSAL_ANALYTICS_COOKIEDOMAIN|default("auto")}}');

{% if GOOGLE_ANALYTICS_DISPLAY_FEATURES %}
ga('require', 'displayfeatures');
{% endif %}
ga('send', 'pageview');
</script>
{% elif GOOGLE_ANALYTICS %}
Expand All @@ -15,7 +19,11 @@
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
{% if GOOGLE_ANALYTICS_DISPLAY_FEATURES %}
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
{% else %}
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
{% endif %}
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

Expand Down

0 comments on commit 1c0cb84

Please sign in to comment.