Hutchy68 / GoogleTagManager

MediaWiki Google Tag Manager
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Reboot of MediaWiki Extension - Google Tag Manager #2

Open Hutchy68 opened 3 years ago

Hutchy68 commented 3 years ago

Hey @kghbln

I recently needed to use this extension on a project and decided to do a reboot of it. Update to extension registration, add a new method to insert the Tag into the page higher up towards the <body> tag, and give a method to use a data element in the <script> to work with cookie scripts that block or allow the firing of the script, adding more cookies.

Thoughts? Do you think it is worth unarchiving the original and making it available again?

Tom

kghbln commented 3 years ago

Hi @Hutchy68

I am sorry for having kept you waiting for such a long time. For Google related stuff I currently still use the "PCR GUI Inserts" extension since it also allows to insert much more than just analytics code. I am aware that the placement of the Google code done by this extension is not ideal but so far it was working good enough for me. In general I'd prefer to give that extension more love that it needs.

Anyhow since you already did some coding and have a working extension at hand I have on objections against un-archiving the documentation and updating for the release you have done. Actually it would be a shame not doing so. I can do this for you if you agree.

Cheers Karsten

IEatApples commented 1 year ago

Hi @Hutchy68 , @kghbln ,

I was looking for a GTM extension for mediawiki and found this one.

I noticed the last comments were almost 2 years ago. I was just wondering if there have been any updates and/or alternatives, or is this extension currently the best option? I noticed it puts the code at the very bottom of the page.

Thanks!

kghbln commented 1 year ago

Apart from the one I mentioned you could give https://www.mediawiki.org/wiki/Extension:GTag a shot.

IEatApples commented 1 year ago

Hi, Thanks for your reply.

I just found this one on Git which seems to work pretty well. https://github.com/harugon/Gtm

It adds the script just before the </head>, and the nonscript just before the end of the </body> in default mode.

The instructions are in Japanese, so I'm not sure what all the configurations do, I only used the default $wgGtmId = "GTM-XXXXXX"; which is what gave me the above result.