- This topic has 7 replies, 4 voices, and was last updated 3 years, 12 months ago by
David.
-
AuthorPosts
-
March 24, 2019 at 12:46 pm #848484
Evan
Hi –
I recently tried to set up Google Analytics by adding my GA tag to the site’s PHP footer. To do this, I had Bluehost support do it for me.
However, when the GA tag was added, my site simultaneously crashed. Bluehost support informed me that the GeneratePress theme was corrupted, something about the PHP not being compatible with Bluehost or something like that.
They were able to switch to another theme and get the site back online, but every time I switch back to the GeneratePress theme, my site crashes with an HTTP 500 error. When I contact Bluehost, they tell me the same thing, that the theme’s PHP files are corrupted and need to be updated.
They’ve told me to reach out to the theme provider for help.
Does any of this make sense? Hopefully. Currently, each time I turn on the GeneratePress theme, the site crashes with a 500 error, and Bluehost tells me only the theme provider can address the PHP issue.
Any help greatly appreciated. The theme has worked great for the past six months or more, and just started crashing the past few days. Perhaps related, I know Bluehost upgraded their PHP on March 13th.
– Evan
GP Premium 1.7.8March 24, 2019 at 4:41 pm #848591Tom
Lead DeveloperLead DeveloperHi there,
It sounds like the code they added to the theme had errors in it. Is it possible to remove that code from the footer?
If not, you’ll want to delete the theme completely and install it again from scratch.
Then you can add the code using a Hook Element instead: https://docs.generatepress.com/article/hooks-element-overview/
If you’d like to share the code here, we can check it for errors.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 25, 2019 at 5:44 pm #849790Evan
Awesome, I was able to get the site back online by deleting/redownloading, thanks!
Regarding the code, I’ve pasted it below. When using a hook, would I paste the entire GA code below, or just a portion?
Thanks as always!
– Evan
<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-100766377-2″></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());gtag(‘config’, ‘UA-100766377-2’);
</script>March 25, 2019 at 6:10 pm #849802Leo
StaffCustomer SupportThe entire block of code is needed 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 26, 2019 at 8:20 pm #850950Evan
Awesome, thanks!
So, I set up the hook like this screenshot here. I’ve also set the display rules to “entire site” for the location.
However, it doesn’t look like Google Analytics is picking anything up. Am I perhaps using the hook incorrectly?
– Evan
March 27, 2019 at 2:11 am #851088David
StaffCustomer SupportHi there
if you’re using Google Tag Manager then they provide a second script that has to be added right the opening body tag. This needs to go in a before_header hook.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 29, 2019 at 4:06 pm #853861Evan
Got it to work, thanks!
March 30, 2019 at 4:10 am #854095David
StaffCustomer SupportGlad to hear that
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.