open-oni / open-oni

Open ONI (Open Online Newspaper Initiative) Django web app
https://open-oni.github.io/
Other
48 stars 23 forks source link

google analytics block demo #181

Open jduss4 opened 8 years ago

jduss4 commented 8 years ago

Put in an example in the theme that shows how a user would add their own google analytics code

jduss4 commented 6 years ago

If we do implement this we will also need to update the Theming article in the wiki

jduss4 commented 6 years ago

Is this something that all our collaborators will want? It might be kind of annoying to comment out this code block the majority of the time if people aren't using it.

If people do want it, though, we would have something pretty generic like this I imagine:

{% block analytics %}
    {# insert your analytics script code here #}
{% endblock analytics %}
techgique commented 4 years ago

If we look to add something as an example, I found a way to render things in templates depending on the host that doesn't require adding a custom context processor etc to make settings variable available to the templates: https://github.com/CDRH/open-oni_nebraska_theme/commit/801db60d3a03db5b50d1e50414bed4be44a81d87

jduss4 commented 4 years ago

Group consensus is to add to the docs describing @techgique 's super example, rather than adding an actual block

techgique commented 4 years ago

:thinking: Maybe focus on just the part that loads for a specific host first. Then mention it could either be added with the block super approach with javascript if they want it in the <head> or they could put just that snippet elsewhere in their templates

jduss4 commented 4 years ago

Adding the tag "good first issue" to this, as by the time a consensus was reached this ended up being only documentation based