From 0d19a79d70802fbdb9e75320115a9e37115e1abd Mon Sep 17 00:00:00 2001 From: Uncle Cheese Date: Mon, 16 Nov 2015 16:38:52 +1300 Subject: [PATCH] Override docsviewer template to use new GA --- themes/docs/templates/DocumentationViewer.ss | 58 ++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 themes/docs/templates/DocumentationViewer.ss diff --git a/themes/docs/templates/DocumentationViewer.ss b/themes/docs/templates/DocumentationViewer.ss new file mode 100644 index 0000000..a6f416a --- /dev/null +++ b/themes/docs/templates/DocumentationViewer.ss @@ -0,0 +1,58 @@ + + + + <% include DocumentationHead %> + +
class="has_versions"<% end_if %>> +
+ <% if Breadcrumbs.count > 1 %> + <% include DocumentationBreadcrumbs %> + <% else_if Page.Title %> +

$Page.Title

+ <% end_if %> + <% if Page.Introduction %> +
+

$Page.Introduction

+
+ <% end_if %> + + <% include DocumentationVersions %> +
+
+ +
+
+ + <% include DocumentationSidebar %> + +
+ $Layout + + <% include DocumentationFooter %> +
+
+
+ + + <%-- New tracking code, added to fix tracking across all domains (which was a problem for Platform section) --%> + (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','//www.google-analytics.com/analytics.js','ga'); + + <%-- Linker is used to track people across the domains, Single-origin Policy prevents cookie-based tracking --%> + ga('create', 'UA-84547-17', 'auto', {'allowLinker': true}); + ga('require', 'linker'); + ga('linker:autoLink', [ + 'silverstripe.com', + 'silverstripe.org', + 'addons.silverstripe.org', + 'api.silverstripe.org', + 'doc.silverstripe.org', + 'userhelp.silverstripe.org', + 'demo.silverstripe.org' + ]); + ga('send', 'pageview') + + <% include DocumentationEnd %> +