Skip to content

Commit f855e7b

Browse files
committed
analytics fix
1 parent e98096a commit f855e7b

File tree

2 files changed

+9
-45
lines changed

2 files changed

+9
-45
lines changed

.github/workflows/update-gh-pages-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run: Expand-Archive ../docfx.zip -DestinationPath ../docfx
2121

2222
- name: Build site with docfx
23-
run: "../docfx/docfx.exe build docfx.json --globalMetadata \"{ '_matomoContainerId': 'kE7MWPi0' }\" --warningsAsErrors"
23+
run: "../docfx/docfx.exe build docfx.json --globalMetadata \"{ '_matomoContainerUrl': 'https://matomo.devexpress.com/js/container_kE7MWPi0.js' }\" --warningsAsErrors"
2424

2525
- name: Archive site
2626
run: Compress-Archive -Path _site/* -DestinationPath ${{ runner.temp }}/site.zip

.template/partials/head.tmpl.partial

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77
<meta name="viewport" content="width=device-width">
88
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
99
<meta name="generator" content="docfx {{_docfxVersion}}">
10-
{{#_matomoContainerId}}
11-
<!-- Matomo Tag Manager -->
12-
<script>
13-
var _mtm = window._mtm = window._mtm || [];
14-
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
15-
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
16-
g.async=true; g.src='https://matomo.devexpress.com/js/container_{{_matomoContainerId}}.js'; s.parentNode.insertBefore(g,s);
17-
</script>
18-
<!-- End Matomo Tag Manager -->
1910
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
2011
<link rel="shortcut icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
2112
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.css">
@@ -26,41 +17,14 @@
2617
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
2718
{{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
2819
{{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}
29-
</head>
30-
31-
{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
32-
33-
<head>
34-
<meta charset="utf-8">
35-
36-
{{/_matomoContainerId}}
37-
{{#_googleAnalyticsTagId}}
38-
<script async src="https://www.googletagmanager.com/gtag/js?id={{_googleAnalyticsTagId}}"></script>
20+
{{#_matomoContainerUrl}}
21+
<!-- Matomo Tag Manager -->
3922
<script>
40-
window.dataLayer = window.dataLayer || [];
41-
function gtag() { dataLayer.push(arguments); }
42-
gtag('js', new Date());
43-
gtag('config', '{{_googleAnalyticsTagId}}');
23+
var _mtm = window._mtm = window._mtm || [];
24+
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
25+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
26+
g.async=true; g.src='{{_matomoContainerUrl}}'; s.parentNode.insertBefore(g,s);
4427
</script>
45-
{{/_googleAnalyticsTagId}}
46-
{{#redirect_url}}
47-
<meta http-equiv="refresh" content="0;URL='{{redirect_url}}'">
48-
{{/redirect_url}}
49-
{{^redirect_url}}
50-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
51-
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
52-
<meta name="viewport" content="width=device-width">
53-
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
54-
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
55-
{{#description}}<meta name="description" content="{{description}}">{{/description}}
56-
<link rel="shortcut icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
57-
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.min.css">
58-
<link rel="stylesheet" href="{{_rel}}styles/docfx.css">
59-
<link rel="stylesheet" href="{{_rel}}styles/main.css">
60-
<meta property="docfx:navrel" content="{{_navRel}}">
61-
<meta property="docfx:tocrel" content="{{_tocRel}}">
62-
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
63-
{{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
64-
{{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}
65-
{{/redirect_url}}
28+
<!-- End Matomo Tag Manager -->
29+
{{/_matomoContainerUrl}}
6630
</head>

0 commit comments

Comments
 (0)