hugo-clarity icon indicating copy to clipboard operation
hugo-clarity copied to clipboard

Feature request: Support for google tag manager

Open rasmusson opened this issue 2 years ago • 1 comments

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.

rasmusson avatar Jun 27 '22 07:06 rasmusson

Ping @onweru and @rootwork for opinions.

chipzoller avatar Jun 27 '22 11:06 chipzoller

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

daemenseth avatar Feb 02 '23 09:02 daemenseth

@daemenseth, I will look into it.

onweru avatar Feb 02 '23 13:02 onweru

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

onweru avatar Feb 03 '23 10:02 onweru

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

daemenseth avatar Feb 03 '23 13:02 daemenseth

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

onweru avatar Feb 03 '23 15:02 onweru

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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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\[email protected]\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

daemenseth avatar Feb 04 '23 09:02 daemenseth

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

hugo mod get -u ./...

onweru avatar Feb 04 '23 10:02 onweru

Yess I did that.

daemenseth avatar Feb 04 '23 10:02 daemenseth

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

onweru avatar Feb 04 '23 12:02 onweru

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

onweru avatar Feb 04 '23 12:02 onweru

@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 avatar Feb 04 '23 19:02 daemenseth

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

daemenseth avatar Feb 05 '23 10:02 daemenseth