chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
571 stars 263 forks source link

Feature request: Support for google tag manager #334

Closed rasmusson closed 1 year ago

rasmusson commented 2 years ago

I use Google tag manager in my site to deploy analytics and more. For now I have made customization to the theme to enable tag manager. Would it be possible to add support for this in the theme?

I could give it a go to try and add it in.

chipzoller commented 2 years ago

Ping @onweru and @rootwork for opinions.

daemenseth commented 1 year ago

Default does google configure a g4 account and that is not working with the default clarity module setup. You have to specify that you want a universal account. That's not clear in the clarity theme setup. Also the universal account is stopping the first of july. So I think this has some more priority to fix

onweru commented 1 year ago

@daemenseth, I will look into it.

onweru commented 1 year ago

@daemenseth, @rasmusson, if you can please test #419.

daemenseth commented 1 year ago

What is the easiest method to test? I used the hugo modules (option 2) to install the theme

onweru commented 1 year ago

@daemenseth, I figured I would just merge 🤞🏼 . Please test and let me know

daemenseth commented 1 year ago

Hi @onweru

I get some errors It lookds like he cannot find: "vendor/google/tag-manager" not found

Start building sites … hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168+extended windows/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio ERROR 2023/02/04 10:47:58 render of "home" failed: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts_default\baseof.html:21:8": execute of template failed: template: index.html:21:8: executing "index.html" at <partial "head" .>: error calling partial: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts\partials\head.html:47:4": execute of template failed: template: partials/head.html:47:4: executing "partials/head.html" at <partial "vendor/google/tag-manager" (dict "noscript" false)>: error calling partial: partial "vendor/google/tag-manager" not found ERROR 2023/02/04 10:47:58 render of "page" failed: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts_default\baseof.html:21:8": execute of template failed: template: _default/single.html:21:8: executing "_default/single.html" at <partial "head" .>: error calling partial: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts\partials\head.html:47:4": execute of template failed: template: partials/head.html:47:4: executing "partials/head.html" at <partial "vendor/google/tag-manager" (dict "noscript" false)>: error calling partial: partial "vendor/google/tag-manager" not found ERROR 2023/02/04 10:47:58 render of "term" failed: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts_default\baseof.html:21:8": execute of template failed: template: _default/list.html:21:8: executing "_default/list.html" at <partial "head" .>: error calling partial: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts\partials\head.html:47:4": execute of template failed: template: partials/head.html:47:4: executing "partials/head.html" at <partial "vendor/google/tag-manager" (dict "noscript" false)>: error calling partial: partial "vendor/google/tag-manager" not found ERROR 2023/02/04 10:47:58 render of "page" failed: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts_default\baseof.html:21:8": execute of template failed: template: _default/single.html:21:8: executing "_default/single.html" at <partial "head" .>: error calling partial: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts\partials\head.html:47:4": execute of template failed: template: partials/head.html:47:4: executing "partials/head.html" at <partial "vendor/google/tag-manager" (dict "noscript" false)>: error calling partial: partial "vendor/google/tag-manager" not found Error: Error building site: failed to render pages: render of "page" failed: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts_default\baseof.html:21:8": execute of template failed: template: _default/single.html:21:8: executing "_default/single.html" at <partial "head" .>: error calling partial: "C:\Users\sethd\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\chipzoller\hugo-clarity@v0.0.0-20230203100413-d0d63c4ab00a\layouts\partials\head.html:47:4": execute of template failed: template: partials/head.html:47:4: executing "partials/head.html" at <partial "vendor/google/tag-manager" (dict "noscript" false)>: error calling partial: partial "vendor/google/tag-manager" not found Built in 99 ms

onweru commented 1 year ago

@daemenseth, since you installed the theme as a Hugo module, have you updated the module? Like

hugo mod get -u ./...
daemenseth commented 1 year ago

Yess I did that.

onweru commented 1 year ago

@daemenseth. Phew! that was a close call, the bug is here. Fixing it now

onweru commented 1 year ago

@daemenseth, I have tested with your installation type. Run hugo mod get -u ./... and re-test

daemenseth commented 1 year ago

@onweru thx for the fast response. No erros anymore with deployment. It looks promising, but I have to check it tomorrow when I have some more data.

daemenseth commented 1 year ago

@onweru Its working I receive data in the GA4 tags accounts. Thx for the fast support.