Nukta Ads

Guides / Web

Integrate with your web project

Publishers place slot divs with placement codes, then load nukta.js once on pages that match a registered hostname.

Before you start

  1. Create a publisher account and register the exact hostname (e.g. ai.nukta.co.tz). Apex and www are treated as the same.
  2. Wait for admin approval if the site is still pending.
  3. Create a placement and copy its code (e.g. plc_ai_50e2b3).

Ad slots (divs)

Put an empty div wherever the ad should appear. The placement code goes on the div — not in the script URL.

<div data-plc="YOUR_PLACEMENT_CODE"></div>

Replace YOUR_PLACEMENT_CODE with the code from your publisher dashboard. Use one div per slot.

Fixed placements still need a data-plc div (it can sit in the footer). The creative then pins to the viewport.

Load the script once

Add nukta.js once per page. It finds every [data-plc] slot and fills it.

<!-- slots anywhere above -->
<div data-plc="plc_home_sidebar"></div>
<div data-plc="plc_article_mid"></div>

<!-- once per page -->
<script src="https://angaza.nukta.co.tz" async></script>

For SPAs after a route change, call NuktaAds.refresh() or NuktaAds.fill().

Google Tag Manager

Keep slot divs in your page template. Fire one Custom HTML tag that loads the script once — do not create a GTM tag per placement.

  1. Add data-plc divs in the site layout / CMS where ads should show.
  2. In GTM, create one Custom HTML tag with the snippet below.
  3. Trigger it on All Pages (or the pages that contain slots).
<script src="https://angaza.nukta.co.tz" async></script>

Page context (better targeting)

Put context on the slot div, or call NuktaAds.setContext() before/after the script. Advertisers match the same keys on campaigns.

<div
  data-plc="YOUR_PLACEMENT_CODE"
  data-section="sports"
  data-lang="sw"
  data-tags="simba,ligikuu"
  data-content-type="article"
  data-audience="guest"></div>
<script>
  NuktaAds.setContext({ audience: 'subscriber', city: 'dar' });
</script>
<script src="https://angaza.nukta.co.tz" async></script>
  • section — Channel or site section (sports, news, business)
  • lang — Page language (sw, en). Auto-filled from html lang when possible
  • tags — Content keywords / topics
  • content_type — article, video, homepage, listing
  • audience — Opaque segments (subscriber, guest) — no PII

Legacy single-placement URLs (?plc=CODE) still work if you need one script next to one slot.

Verify

  1. Open the live page on the registered host (not a random localhost unless you registered that host).
  2. Accept consent once, then confirm each data-plc slot fills.
  3. Check impressions in the publisher or admin dashboard.

Flutter app →