Archived topic
Moving GA code from plugin to hook
5 replies · Started by Gabi on November 21, 2019
Hello, I have a question regarding the insert Header and Footer plugin. I'm changing from another theme to GP Premium. With my previous theme, my GA code was added throughout the site with the plugin. However, I'd like to get rid of the plugin and use a hook. Do I have to do this before installing GP or can I do it after? And if I do it after, do I generate a GA code duplication until I don't disable/delete the Header Footer plugin? My concern is mainly because I'm not working on a new site, but on a site with over 4 years worth of content
I hope this question is clear.
Thank you!
Hi there,
It shouldn't matter - To my understanding, GA code is attached to your site URL.
I would say just get everything set up in GP first then remove the plugin.
Let me know if this helps :)
To make it crystal clear and avoid messing up: "
I would say just get everything set up in GP first then remove the plugin." you mean also including adding the GA hook, correct?
Thanks a lot!
Hi there,
yes - set up the Hook with the GA code and then remove your plugin.
Between adding the hook and removing the code, you will have duplicate GA codes, for this short amount of time some metrics may be double counted - which i can't see being an issue.
Awesome, thanks a lot for the help!
Glad we could be of help