Houman
January 9, 2021, 6:21pm
1
After inserting the Google Analytics code into config.toml → googleAnalytics = "xxx"
Hugo generates two js links:
<head>
<script async src="https://www.google-analytics.com/analytics.js"></script>
...
<script type="application/javascript">...</script>
<script type="application/javascript">...</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</head>
Is this normal that two async links are generated on top and bottom of head tag?
Many Thanks,
Houman
Difficult to say without seeing the head
template of your project.
Most likely you are calling the GA code twice.
If the issue persists you will need to share the project or a project with dummy content that reproduces the issue.
Houman
January 9, 2021, 6:37pm
3
Thank you for your support.
I was just able to reproduce it easily.
1) Download the Vex-hugo https://github.com/themefisher/vex-hugo.git
2) vim ./vex-hugo/exampleSite/config.toml
and change googleAnalytics = "UA-111111111-1" and save.
3) cd ./vex-hugo/exampleSite
4) hugo server --themesDir ../..
Now check the source code of homepage and you will see the duplication.
Many Thanks,
Houman
You need to talk to the theme authors. Please file an issue at the theme repo.
Unless @gethugothemes replies to you here.
Houman
January 9, 2021, 6:55pm
5
@alexandros thanks for mentioning us . We already fixed his issue in github.
system
Closed
January 14, 2021, 7:47pm
7
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.