AI-generated summary
A user, tohaitrieu , shared a step-by-step guide on how to add Google Auto Ads to Discourse via Google Tag Manager. The process involves creating a user-defined variable, configuring a tag, and pasting the GTM ID in Discourse settings. tohaitrieu confirmed that this method works on their website, https://babyforex.net .
However, another user, avndp , reported that the method didn’t work for their Discourse site, https://www.praja.net . tohaitrieu suggested that avndp might have missed a step.
Other users, such as Molly_Forster , expressed interest in trying the method, but tohaitrieu pointed out that Molly_Forster’s website, https://longboardpro.com , runs on WordPress CMS, which may not be compatible with the guide.
I tried and found the way to add Google Auto Ads to Discourse via Google Tag Manager.
Login to Google Tag Manager: https://tagmanager.google.com/#/home , Choose Workspace
Create a new user defined variable and call it asClientID
Configure the variable as a Constant. The value to enter is your AdSense Client ID
Click on Tags on the left side of the screen within your GTM workspace
Create a new Tag called AS - Page view - ALL
Tag Type: Custom HTML
Copy this code to HTML:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "{{asClientID}}",
enable_page_level_ads: true
});
</script>
Triggering choose All Pages
Preview and Publish.
Get GTM ID
In Admin → Settings → Search GTM and paste GTM ID, confirm.
You can check in my website at https://babyforex.net.
Hope help you!
6 Likes
avndp
(Aravind)
September 26, 2020, 6:44pm
2
Is this still working? I tried all the above steps, but no luck at my discourse site https://www.praja.net/
Any other solution?
1 Like
Yes, It’s working. Have you missed any step?
1 Like
@Trieu if it is work then i will also try on on my website.
this is my website longboardpro.com i want to apply on it
1 Like
Your website is running WordPress CMS.