Closed ascandella closed 7 years ago
Hello @sectioneight,
googleAnalytics
variable is set in the config file.Goood question. I tried the async version first but it wouldn't fire events in my testing. Since it's at a script block at the bottom of the page it shouldn't matter anyway as far as page load times. The sync version is also the code snippet that GA gives you.
Didn't realize the internal template was already checking-- I'll fix that
PR updated to remove the extraneous if
blocks. If you're not interested in this functionality that's fine, I'll just use my own fork. But it's a lovely theme (thank you for making it!) and thought others may want GA tracking.
Awesome, thanks!
Per the documentation: https://discuss.gohugo.io/t/implementing-google-analytics-in-hugo/2671/2
If you set a top-level
googleAnalytics
key, we should enable it.This PR does that.