- This topic has 7 replies, 4 voices, and was last updated 2 years, 3 months ago by David.
March 24, 2019 at 12:46 pm #848484Evan
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.
– EvanGP Premium 1.7.8March 24, 2019 at 4:41 pm #848591TomLead DeveloperLead Developer
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.March 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!
<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-100766377-2″></script>
window.dataLayer = window.dataLayer || ;
gtag(‘js’, new Date());
</script>March 25, 2019 at 6:10 pm #849802LeoStaffCustomer SupportMarch 26, 2019 at 8:20 pm #850950Evan
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?
– EvanMarch 27, 2019 at 2:11 am #851088DavidStaffCustomer SupportMarch 29, 2019 at 4:06 pm #853861Evan
Got it to work, thanks!March 30, 2019 at 4:10 am #854095
- You must be logged in to reply to this topic.