通过 Google Tag Manager 将 Google Auto Ads 添加到 Discourse

I tried and found the way to add Google Auto Ads to Discourse via Google Tag Manager.

  1. Login to Google Tag Manager: https://tagmanager.google.com/#/home, Choose Workspace

  2. Create a new user defined variable and call it asClientID

  1. Configure the variable as a Constant. The value to enter is your AdSense Client ID

  1. Click on Tags on the left side of the screen within your GTM workspace

  2. 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.

  1. Get GTM ID

  1. In Admin → Settings → Search GTM and paste GTM ID, confirm.

You can check in my website at https://babyforex.net.

Hope help you!

6 个赞

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 个赞

Yes, It’s working. Have you missed any step?

1 个赞

@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 个赞

Your website is running WordPress CMS.