Skip to content

Ads module (injection & delivery)

The ads module bulk-injects ad code or custom JS (ad networks, analytics scripts, …) across your site network: configure once, push to many servers / domains, and remove in one click. You can scope delivery by server, batch or domain. Every visitor — real users and search-engine crawlers alike — receives the same page content.

Each ad uses one delivery method:

MethodWhere it runsIn one line
JS injection (js_ssh)Your serverWrites a .js file into the site directory and adds a <script> reference before </body> on every page
Gateway injection (gateway)goco managed-hosting gatewayThe goco gateway injects the script into managed-hosting sites — no server or Cloudflare account needed

Prerequisites: js_ssh needs your own server (goco can SSH in); gateway is only for goco managed-hosting sites.

  • Injected code / JS: paste HTML (wrap JS in <script>) or plain JS. The editor checks that angle brackets are paired and flags full-width Chinese <> (browsers ignore them so the script never runs; one click converts them to ASCII).
  • Injection point: before </body> by default (the safest choice); other anchors such as inside <head> are available.
  • Not a JS person? Use the built-in ad code generator: pick a common pattern (full-page redirect / full-screen iframe overlay / load a third-party script / click popup), enter the target URL, and it generates and fills in the code.

“Delivery scope” decides which domains the ad applies to:

  • Whole server: every domain you own on that server (for gateway ads, “all managed-hosting domains”).
  • Only these domains: just the domains you list (one per line).
  • Exclude these domains: the whole server except the domains listed.

You can also pick one or more batches to fill their domains into the scope box (editing the domains by hand deselects the batch; domains added to a batch later are not picked up automatically — re-select the batch).

After an ad is deployed, the system detects the landing domain visitors are sent to from your injected code (preferring redirect targets such as location / href / window.open and ignoring trackers and CDNs); you can override it if detection is off. It then probes that domain from several vantage points:

  • Free basic checks (goco outside-China probes / OONI reference): reachability, HTTPS certificate, GFW blocking.
  • Mainland-China checks (needs your boce probing key, billed to your boce account): mainland speed, DNS resolution, DNS hijack / pollution, mainland blocking, QQ / WeChat blocking, ICP blacklist, and more.

You can set each check’s interval and a daily check cap, and click “Check now” to trigger one manually (with a cooldown). Check settings are global, results are shared across ads, and nothing is billed twice.

  1. After filling in the name, method, content and scope, click “Deploy now” (or “Save & deploy”). Progress shows a per-domain result: success / failed / skipped (in the DB but no matching site directory on the server) / 301 covered.

  2. After deploying, open the site with a tool such as PageSpeed Insights to confirm the ad shows up.

  3. “Uninstall ad” removes the injected .js file / <script> tag from every domain it was deployed to, so no orphaned rules are left behind; you can redeploy at any time. You must uninstall all deployments before deleting an ad.