Open Oran-Ac opened 2 years ago
If changing the setting in _config.yml
doesn't work, you may replace the following lines in /_layouts/homepage.html
with the code provided by Google Analytics:
https://github.com/yaoyao-liu/minimal-light/blob/599feb2dfe99d28a836efb0bd3aaa45743c2c23a/_layouts/homepage.html#L84-L91
@yaoyao-liu please replace the code for g-analytics with below code. I intended to open a PR for this. However, the repo does not provide permission to create a new branch.
{% if site.google_analytics %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}
@yaoyao-liu please replace the code for g-analytics with below code. I intended to open a PR for this. However, the repo does not provide permission to create a new branch.
{% if site.google_analytics %} <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '{{ site.google_analytics }}'); </script> {% endif %}
hi, I tried your code but failed, too. Is this the completed code?
Hi, I would like to ask if the google analytics can be used by just changing the settings in _config.yml
google_analytics: UA-111540567-4
I tried but I couldn't get any data in google analytics