Skip to content

Commit

Permalink
Fix Matomo noscript tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bittner committed Jul 6, 2022
1 parent 6885243 commit f487cb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion analytical/templatetags/matomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//%(url)s/piwik.php?idsite=%(siteid)s" style="border:0;" alt="" /></p></noscript>
<noscript><p><img src="//%(url)s/matomo.php?idsite=%(siteid)s" style="border:0;" alt="" /></p></noscript>
""" # noqa

VARIABLE_CODE = '_paq.push(["setCustomVariable", %(index)s, "%(name)s", "%(value)s", "%(scope)s"]);' # noqa
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_tag_matomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def test_tag(self):
r = self.render_tag('matomo', 'matomo')
assert '"//example.com/"' in r
assert "_paq.push(['setSiteId', 345]);" in r
assert 'img src="//example.com/piwik.php?idsite=345"' in r
assert 'img src="//example.com/matomo.php?idsite=345"' in r

def test_node(self):
r = MatomoNode().render(Context({}))
assert '"//example.com/";' in r
assert "_paq.push(['setSiteId', 345]);" in r
assert 'img src="//example.com/piwik.php?idsite=345"' in r
assert 'img src="//example.com/matomo.php?idsite=345"' in r

@override_settings(MATOMO_DOMAIN_PATH='example.com/matomo',
MATOMO_SITE_ID='345')
Expand Down

0 comments on commit f487cb8

Please sign in to comment.