Skip to content

Commit

Permalink
analytics fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DXInfinity committed Feb 16, 2024
1 parent e98096a commit f855e7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-gh-pages-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: Expand-Archive ../docfx.zip -DestinationPath ../docfx

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

- name: Archive site
run: Compress-Archive -Path _site/* -DestinationPath ${{ runner.temp }}/site.zip
Expand Down
52 changes: 8 additions & 44 deletions .template/partials/head.tmpl.partial
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
<meta name="viewport" content="width=device-width">
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
<meta name="generator" content="docfx {{_docfxVersion}}">
{{#_matomoContainerId}}
<!-- Matomo Tag Manager -->
<script>
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://matomo.devexpress.com/js/container_{{_matomoContainerId}}.js'; s.parentNode.insertBefore(g,s);
</script>
<!-- End Matomo Tag Manager -->
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
<link rel="shortcut icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.css">
Expand All @@ -26,41 +17,14 @@
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
{{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
{{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}
</head>

{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}

<head>
<meta charset="utf-8">

{{/_matomoContainerId}}
{{#_googleAnalyticsTagId}}
<script async src="https://www.googletagmanager.com/gtag/js?id={{_googleAnalyticsTagId}}"></script>
{{#_matomoContainerUrl}}
<!-- Matomo Tag Manager -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{_googleAnalyticsTagId}}');
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='{{_matomoContainerUrl}}'; s.parentNode.insertBefore(g,s);
</script>
{{/_googleAnalyticsTagId}}
{{#redirect_url}}
<meta http-equiv="refresh" content="0;URL='{{redirect_url}}'">
{{/redirect_url}}
{{^redirect_url}}
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
{{#description}}<meta name="description" content="{{description}}">{{/description}}
<link rel="shortcut icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.min.css">
<link rel="stylesheet" href="{{_rel}}styles/docfx.css">
<link rel="stylesheet" href="{{_rel}}styles/main.css">
<meta property="docfx:navrel" content="{{_navRel}}">
<meta property="docfx:tocrel" content="{{_tocRel}}">
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
{{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
{{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}
{{/redirect_url}}
<!-- End Matomo Tag Manager -->
{{/_matomoContainerUrl}}
</head>

0 comments on commit f855e7b

Please sign in to comment.