Hi Guys, I’ve installed the Google analytics code into the user/themes/deliver/templates/partials/base.html.twig file in between {{ assets.js() }} and {% endblock head%}
Looking at the page source the tracking code is sitting where it should (just before the ) but it seems that Google Analytics isn’t picking up the code…weird? Any ideas why this would be?
Ok… everything appears to be fine. One thing you can try is replacing:
<script>
with
<script type="text/javascript">
in your analytics code.
But i don’t think it’s an issue. Also make sure that in your analytics date is set to Today. By default Google Analytics sets date for yesterday.
You can also check if Analytics collect data by going into Real-Time tab: https://support.google.com/analytics/answer/1008083?hl=en
I don’t think it’s related to deliver anyways… Mostly it’s a configuration issue.
Just to add onto this post I noticed that when I updated the template version it’s wiped out my analytics code.
So I’ve now added the code to the theme I’ve set up under user/themes/mytheme/templates/partials/base.html.twig using theme inheritance and that should solve the issue of future template updates.