mirror of
https://github.com/adulau/brouilleursdeblanc.git
synced 2024-11-27 04:27:12 +00:00
c34e3b80f6
Updating GA Analytics tracking code to support Demographics Analytics https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad
61 lines
2.2 KiB
HTML
61 lines
2.2 KiB
HTML
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
|
<script>window.jQuery || document.write('<script src="{{ site.url }}/assets/js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
|
|
<script src="{{ site.url }}/assets/js/scripts.min.js"></script>
|
|
{% if site.search %}
|
|
<!-- Jekyll Simple Search option -->
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.search-field').jekyllSearch({
|
|
jsonFile: '{{ site.url }}/search.json',
|
|
searchResults: '.search-results',
|
|
template: '<li><article><a href="{url}">{title} <span class="entry-date"><time datetime="{date}">{shortdate}</time></span></a></article></li>',
|
|
fuzzy: true,
|
|
noResults: '<p>Nothing found.</p>'
|
|
});
|
|
});
|
|
|
|
(function( $, window, undefined ) {
|
|
|
|
var bs = {
|
|
close: $(".close-btn"),
|
|
searchform: $(".search-form"),
|
|
canvas: $("body"),
|
|
dothis: $('.dosearch')
|
|
};
|
|
|
|
bs.dothis.on('click', function() {
|
|
$('.search-wrapper').css({ display: "block" });
|
|
bs.searchform.toggleClass('active');
|
|
bs.searchform.find('input').focus();
|
|
bs.canvas.toggleClass('search-overlay');
|
|
});
|
|
|
|
bs.close.on('click', function() {
|
|
$('.search-wrapper').removeAttr( 'style' );
|
|
bs.searchform.toggleClass('active');
|
|
bs.canvas.removeClass('search-overlay');
|
|
});
|
|
})( jQuery, window );
|
|
</script>
|
|
{% endif %}
|
|
{% if site.owner.google.analytics %}
|
|
<!-- Asynchronous Google Analytics snippet -->
|
|
<script>
|
|
var _gaq = _gaq || [];
|
|
var pluginUrl =
|
|
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
|
|
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
|
|
_gaq.push(['_setAccount', '{{ site.owner.google.analytics }}']);
|
|
_gaq.push(['_trackPageview']);
|
|
|
|
(function() {
|
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
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>
|
|
{% endif %}
|
|
|
|
{% if page.comments %}
|
|
{% include disqus_comments.html %}
|
|
{% endif %}
|