You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Baseframe has included support for Google Analytics since the beginning. We have considered using other tools such as Matomo (formerly Piwik) and Mixpanel, but never gotten around to it.
This has come up again following a recent policy change to engage with users on the platforms they prefer to be on, rather than insisting on them coming to our websites: we now need to use the analytics tools and trackers provided by these platforms, such as Facebook Pixel. Baseframe should include a formal specification for how an app/website may use trackers:
A list of supported analytics tools and trackers could be considered in the comments on this section.
Baseframe currently recognises a GA_CODE key in config for Google Analytics. Other tools could be recognised with <id>_CODE keys, where a non-blank value requests insertion of that tool's JavaScript snippet. A tool that doesn't require a specific code could be set to True.
Baseframe compiles these codes into app.config['analytics'][name.lower()], so that the code for (say) Google Analytics could be inspected from a template with {% if config.analytics.ga %}. Alternatively, this is specified in the config file itself as a dictionary, with Baseframe providing backwards compatibility for GA_CODE.
The JS code to be inserted could be included as macros in a analytics.html.jinja2 template, invoked from baseframe.html.jinja2.
If the browser sets the Do Not Track (DNT) flag, none (?) of these tools are inserted into the page. This check could be part of the tool's own code, since something like Matomo (Piwik) is self-hosted and is not a third-party tracker.
Various parts of the page may want to interact with an analytics tool, such as to report events. Baseframe must provide a way to flag whether the tool is currently available. This could be via the window.Baseframe global object.
The text was updated successfully, but these errors were encountered:
Baseframe has included support for Google Analytics since the beginning. We have considered using other tools such as Matomo (formerly Piwik) and Mixpanel, but never gotten around to it.
This has come up again following a recent policy change to engage with users on the platforms they prefer to be on, rather than insisting on them coming to our websites: we now need to use the analytics tools and trackers provided by these platforms, such as Facebook Pixel. Baseframe should include a formal specification for how an app/website may use trackers:
GA_CODE
key in config for Google Analytics. Other tools could be recognised with<id>_CODE
keys, where a non-blank value requests insertion of that tool's JavaScript snippet. A tool that doesn't require a specific code could be set toTrue
.app.config['analytics'][name.lower()]
, so that the code for (say) Google Analytics could be inspected from a template with{% if config.analytics.ga %}
. Alternatively, this is specified in the config file itself as a dictionary, with Baseframe providing backwards compatibility forGA_CODE
.analytics.html.jinja2
template, invoked frombaseframe.html.jinja2
.window.Baseframe
global object.The text was updated successfully, but these errors were encountered: