mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Fix Matomo noscript tag
Reference: https://matomo.org/faq/how-to/faq_176/
This commit is contained in:
parent
688524305f
commit
f487cb895c
2 changed files with 3 additions and 3 deletions
|
|
@ -37,7 +37,7 @@ TRACKING_CODE = """
|
|||
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
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ class MatomoTagTestCase(TagTestCase):
|
|||
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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue