@myatix,
Thanks for all the info and questions.
I don’t see anything in the GCR integration guide about putting it before Analytics. In fact, I see the opposite… “Place the code just before the closing </BODY> tag on the page. When placed with the survey opt-in code, the order does not matter.”
I appreciate your suggestion of using wp_enqueue_script because I am also usually a stickler for this. However, in this case, it’s not only the external javascript, but also some inline javascript code that needs to come after the external js. So far, I have avoided using wp_enqueue_script because it might cause problems if it gets minified, deferred, and runs after the inline javascript code.
Anyway, back to the issue at hand, I’m hooking into ‘wp_footer’ to output the code snippet from Google. But, apparently it’s not working on your site.
Here are some things I would check…
– The Avada theme should be using wp_footer(), but since you’re using a child theme, double-check the footer.php file to make sure it has that function.
– WP Rocket is awesome. It should not cause any problems. I see that you have re-enabled it since I didn’t follow up as quick as you’d like. But, when it’s deactivated, can you see the code snippet show up in the footer when you view source? Or, if you don’t want to deactivate WP Rocket, at least have you cleared the cache since you installed this?
– Cloudflare is also awesome, but just to make sure it’s not causing any problems, try turning on “Development Mode” briefly and again view source to see if you find the code in the footer.
I hope this helps. Let me know how it goes.