Archived topic
inserting Google analytics and AdSense code
9 replies · Started by Manoj Kumar on January 9, 2023
Hello,
How can I insert Google analytics, AdSense code or any js code into desired place without using any other third party plugin. Please help me with this.
Thank You
Hi ManoJ,
You can use a Hook Element. You can add <script> tags there. Reference: https://docs.generatepress.com/article/hooks-element-overview/
Here's the hooks visual guide: https://docs.generatepress.com/article/hooks-visual-guide/
If the hook isn't available, you can create one. Example: https://generatepress.com/forums/topic/hooks-related-question/#post-2170598
Hello,
Thanks for your reply.
How can I place AdSense code between paragraphs.
Thank You
To clarify, do you want to add your code after all Paragraph Blocks? Or, do you want to place them manually between specific Paragraphs only?
Hi,
not after all paragraph but after specific paragraph.
Thank You
Hi there,
see Fernandos reply here:
Hello,
I need to set different AdSense Code for Desktop and Mobile using Hook element. Also let me know I can display Ad in center. Please help me in this.
Thank You
You can try this solution:
https://generatepress.com/forums/topic/add-element-with-shortcode-and-diplay-it-just-in-mobile/#post-2480107
But also be aware of the side effect:
https://generatepress.com/forums/topic/add-element-with-shortcode-and-diplay-it-just-in-mobile/#post-2480635
Thank You
Is there any way so that I can align Ads in center instead of left or right?
Thank You
Can I see the ads?