diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-07-08 23:53:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-08 23:53:02 +0300 |
commit | 20aa97234806d9301f6e2bd459965a3432f73580 (patch) | |
tree | 5d4b894c23c3733328c7b373a17e103e1c7d8ccf /plugins/Morpheus | |
parent | 3e7e82d5b839d6f20afe162807c29190d998dbeb (diff) |
Generated tracking code should init window._paq and only use async (#16190)
Diffstat (limited to 'plugins/Morpheus')
-rw-r--r-- | plugins/Morpheus/templates/javascriptCode.twig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/Morpheus/templates/javascriptCode.twig b/plugins/Morpheus/templates/javascriptCode.twig index dfa863d0d2..20780230d2 100644 --- a/plugins/Morpheus/templates/javascriptCode.twig +++ b/plugins/Morpheus/templates/javascriptCode.twig @@ -1,6 +1,6 @@ <!-- Matomo --> <script type="text/javascript"> - var _paq = window._paq || []; + var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ {$options} _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); @@ -9,7 +9,7 @@ {$optionsBeforeTrackerUrl}_paq.push(['setTrackerUrl', u+'{$matomoPhpFilename}']); _paq.push(['setSiteId', '{$idSite}']); {% if loadAsync %}var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'{$matomoJsFilename}'; s.parentNode.insertBefore(g,s);{% endif %} + g.type='text/javascript'; g.async=true; g.src=u+'{$matomoJsFilename}'; s.parentNode.insertBefore(g,s);{% endif %} })(); </script> |