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
- Create a publisher account and register the exact hostname (e.g. ai.nukta.co.tz). Apex and www are treated as the same.
- Wait for admin approval if the site is still pending.
- 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.
- Add data-plc divs in the site layout / CMS where ads should show.
- In GTM, create one Custom HTML tag with the snippet below.
- 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 possibletags— Content keywords / topicscontent_type— article, video, homepage, listingaudience— Opaque segments (subscriber, guest) — no PII
Legacy single-placement URLs (?plc=CODE) still work if you need one script next to one slot.
Consent
The tag shows its own consent dialog automatically — publishers cannot disable it. The choice is remembered on the visitor’s device for about one year. Until accepted, ads may still show, but page context and impression tracking stay off.
Verify
- Open the live page on the registered host (not a random localhost unless you registered that host).
- Accept consent once, then confirm each data-plc slot fills.
- Check impressions in the publisher or admin dashboard.