Add support for Google Tag Manager
Add support for Google Tag Manager tracking code into the included themes and the configuration template.
This commit is contained in:
@@ -171,6 +171,9 @@ ignore_files = []
|
||||
# Google Analytics tracking code (UA-xxxx-x)
|
||||
# google_analytics = ''
|
||||
|
||||
# Google Tag Manager tracking code (GTM-xxxxxx)
|
||||
# google_tag_manager = ''
|
||||
|
||||
# Piwik tracking
|
||||
# tracker_url must not contain trailing slash.
|
||||
# Example : {'tracker_url': 'http://stats.domain.com', 'site_id' : 2}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% include 'gtm.html' %}
|
||||
<div class="container">
|
||||
<div class="four columns">
|
||||
<div class="sidebar">
|
||||
|
||||
11
sigal/themes/default/templates/gtm.html
Normal file
11
sigal/themes/default/templates/gtm.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% if settings.google_tag_manager %}
|
||||
<!-- Google Tag Manager -->
|
||||
<noscript><iframe src="//www.googletagmanager.com/ns.html?id={{settings.google_tag_manager}}"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','{{settings.google_tag_manager}}');</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
{% endif %}
|
||||
@@ -29,6 +29,7 @@
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
{% include 'gtm.html' %}
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1><a href="{{ album.index_url }}">{{ index_title }}</a></h1>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% include 'gtm.html' %}
|
||||
<div class="container">
|
||||
<h1><a href="{{ album.index_url }}">{{ index_title }}</a></h1>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user