Skip to content

Install on WordPress

In WordPress, open Plugins → Add New, search for TerraGaming Media Ads, then Install and Activate.

2. Paste your site tag in the plugin settings

Section titled “2. Paste your site tag in the plugin settings”

Open Settings → TerraGaming Media and paste the site tag the portal shows under Ad Units & Tags → Install site tag. Then Save. The plugin adds it to the <head> of every page:

<script async src="https://tgmads.example.com/tag.js"></script>

You can also fill in the fields under Advanced (host, property and publisher ids) instead.

Use any of these, with the ad unit ids from the portal:

  • Block: add the TerraGaming Media Ad block in the editor and enter the unit id.
  • Widget: add the TerraGaming Media Ad widget to a sidebar (Appearance → Widgets).
  • Shortcode: anywhere shortcodes work:
[tgm_ad unit="TGM-ABC-HRS01"]

In-article ads are automatic. The plugin marks the post content, so the tag can find your paragraphs on any theme. Turn it off under Settings → TerraGaming Media if you prefer your own article selector.

The plugin excludes the tag from WP Rocket’s delay-JavaScript, LiteSpeed Cache, Autoptimize and SiteGround Optimizer. If you use another optimiser, exclude tag.js from combining, deferring and delaying.

Paste the site tag into your theme’s header (or with a header/footer plugin). Then place each unit with a Custom HTML block or widget containing <div data-tgm-unit="TGM-…"></div>. See Install on any HTML site.

On a post, run window.tgm.status() in the browser console. Within about 10 minutes the portal shows Tag detected.