Opengraph and Twittercard URLS fixing + new g.analytics global tracker

This commit is contained in:
David Adrián Cañones Castellano 2017-09-08 17:31:50 +02:00
parent e7c18e80b0
commit 6f63ec40cd
2 changed files with 17 additions and 18 deletions

View File

@ -1,17 +1,16 @@
{% if GOOGLE_ANALYTICS %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{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://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{GOOGLE_ANALYTICS}}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
{% if GAUGES %}
<script type="text/javascript">
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
@ -23,10 +22,10 @@
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</script>
{% endif %}
{% if PIWIK_URL and PIWIK_SITE_ID %}
<script type="text/javascript">
<script type="text/javascript">
{% if PIWIK_SSL_URL %}
var pkBaseURL = "{{ PIWIK_SSL_URL }}";
{% else %}
@ -42,5 +41,5 @@
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
</script>
{% endif %}

View File

@ -38,7 +38,7 @@
<meta property="twitter:image" content="{{ SITEURL }}/{{ article.twitter_image }}">
{% endif %}
{% elif article.header_cover %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ article.header_cover }}">
<meta name="twitter:image" content="{{ SITEURL }}{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}
@ -78,7 +78,7 @@
<meta property="og:image" content="{{ SITEURL }}/{{ article.og_image }}">
{% endif %}
{% elif article.header_cover %}
<meta property="og:image" content="{{ SITEURL }}/{{ article.header_cover }}">
<meta property="og:image" content="{{ SITEURL }}{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta property="og:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}