Newad Advanced AdTracking
v1.2.2newad · 2026年11月16日 上架
Injects the Newad AAT tag and proxies collection same-origin, for sites whose CSP blocks Newad's default collection domain (aat.newad.com.br).
- 正在使用
- 10 以下
- 评分
- 暂无
- 累计下载
- 164
- 最近更新
- 2026年11月18日
贡献者
This plugin is an alternative to the subdomain CNAME (custom_collection_domain, configured via
aat_console) for clients whose Content-Security-Policy blocks aat.newad.com.br. Instead of
depending on the client’s own DNS team, the plugin runs inside WordPress itself: it injects the
nwd_aat_tag.js tag pointing to the site’s own REST routes and proxies collection
server-to-server to Newad’s real service. Since the visitor’s request never leaves the client’s
domain, no CSP rule applies to it.
The plugin does not replace the tag — nwd_aat_tag.js is fetched from the upstream at runtime
and served verbatim, cached. Funnel classification stays entirely on Newad’s backend; the plugin
is a pure byte proxy.
REST routes created (namespace newad-aat/v1):
GET /wp-json/newad-aat/v1/collect— relaysd/debugto/v1/collectupstream.GET /wp-json/newad-aat/v1/tag.js— servesnwd_aat_tag.js, cached (1-hour transient plus a
persistent “last good” fallback).GET /wp-json/newad-aat/v1/banner.js— serves the Newad Consent Manager cookie notice,
cached, only when enabled in the plugin’s settings.GET /wp-json/newad-aat/v1/proof— relays the visitor’s consent choice upstream, only when
the Newad Consent Manager is enabled.
All four routes are public and unauthenticated — the same public surface the real upstream
endpoints already have (they don’t require authentication either, since that’s a hard
requirement for working as a tracking tag/pixel).
Admin screen (Settings Newad AdTracking):
- Required “Site code” field (the advertiser’s code at Newad) — while it’s empty, no tag is
injected. collect_alltoggle (mirrorswindow.nwdAatConfig.collect_all).- “Test installation” button — confirms server-side whether a collection event has arrived.
- “Scan this site” button — looks for an old, hand-pasted Newad tag on the homepage and in the
active theme’s files, and reports the file and line. Read-only; it never modifies the site. - Read-only catalog of suggested selectors for WooCommerce, Contact Form 7 and Gravity Forms
(plus a notice for Elementor), to paste as a scenario in the Newad console.
External services
This plugin is the transport layer for the Newad AAT tag — it only exists to talk to Newad’s
service at https://aat.newad.com.br (operated by Newad, hired by this site’s administrator).
The destination is hard-coded in the plugin: no setting, URL parameter or filter can change it.
The plugin makes 4 calls to that service, all through wp_remote_get():
- On every site visit (public route
GET /wp-json/newad-aat/v1/collect, triggered by the
tag in the visitor’s browser): relays the event payload the tag already generated — page
visited, referrer, campaign parameters (UTM/click) and a pseudonymous visitor identifier
(nwd_uid, generated by the tag itself; never a name, email or ID document). The plugin does
not read or alter this payload, it only retransmits it. - When the tag script and the cookie notice load (
/tag.jsand/banner.jsroutes, cached
for up to 1 hour): fetches the files published by Newad. The only data sent is the “Site code”
filled in on the plugin’s settings screen — it identifies the client’s account at Newad, not
the visitor. - When a choice is recorded on the cookie notice (
/proofroute, only when the Newad
Consent Manager is enabled): relays the visitor’s choice (accepted/rejected categories and
notice version) as proof of consent. - The “Test installation” button (admin screen, triggered manually by whoever administers
the site) queries the upstream to confirm whether a collection event has arrived.
Privacy policy: https://aat.newad.com.br/privacy/advanced-adtracking
Terms of use: https://aat.newad.com.br/terms/advanced-adtracking