Seatext library / BotRefund evidence

Can I Implement BotRefund on a Custom‑Built Website? Yes — Here's the Integration Path

Yes. BotRefund provides a universal REST API and webhook system that works with any custom stack. You'll need to handle authentication, map your events to BotRefund's expected payloads, and implement idempotency keys to prevent...

Built for advertisers who need clear, refund-ready traffic evidence.

Yes, you can implement BotRefund on a custom‑built website. The platform exposes a universal REST API and webhook endpoints that accept traffic data from any backend — Node, Python, PHP, Go, Java, or anything else that can make HTTPS requests. There is no platform‑specific plugin required; you send session, click, and conversion events from your own code and receive scored results back via webhook or polling.

The integration work falls into three buckets: authentication (API keys and HMAC‑signed webhooks), event mapping (translating your internal data model into BotRefund's schema), and reliability (idempotency keys, retry logic, and ordering guarantees). If you already have a middleware layer or an event bus, the effort is mostly wiring. If you're building from scratch, plan for a few days of engineering time to get the contract right and run a sandbox audit before going live.

What BotRefund Actually Does for Custom Sites

BotRefund's core job is to detect automated traffic that clicks your Google and Meta ads, capture video‑style evidence for each suspicious session, and submit refund claims to the ad platforms on your behalf. The detection engine runs 106 independent behavioral checks — things like ghost clicks, honeypot interactions, robotic mouse paths, superhuman input speed, and impossible tab‑switch timing — then feeds the full signal set into an AI model that scores each visit as human or bot with a reported 99% accuracy.

For a custom site, you are responsible for getting the raw behavioral telemetry from the browser to your server, then forwarding the relevant fields to BotRefund's API. The platform does not inject its own JavaScript into your pages unless you choose to add the optional client‑side snippet; the API path is fully server‑to‑server.

Integration Options at a Glance

MethodBest ForSetup EffortData ControlLatency Impact
Universal REST API + WebhooksFull custom stacks, event‑driven architectures, teams that want zero client‑side dependenciesMedium — requires backend wiring, schema mapping, idempotency handlingComplete — you decide what leaves your serverOne extra HTTPS round‑trip per event (typically <100 ms)
Client‑side Snippet + APIHybrid setups where you want BotRefund to collect behavioral signals automaticallyLow — paste snippet, then enrich with server‑side calls for conversionsPartial — snippet sends raw behavioral data directly to BotRefundSnippet runs in browser; server call only on conversion
CSV Upload (Payout Reconciliation)Affiliate programs that need commission audits without real‑time integrationVery low — manual or scheduled uploadBatch only — no real‑time scoringNone at runtime

Takeaway: Choose the pure REST API path if you already own the event pipeline and want zero third‑party scripts on your pages. Choose the snippet hybrid if you want BotRefund to handle the heavy behavioral collection and you only need to send conversion confirmations. Choose CSV upload only for periodic affiliate payout audits.

Step‑by‑Step Decision Framework

  1. Inventory your event sources. List every place a click, session start, form submit, or purchase originates — frontend routers, backend controllers, message queues, analytics layer.
  2. Map to BotRefund's event schema. The API expects at minimum: session_id, click_id (from Google/Meta click parameters), timestamp, event_type (pageview, click, conversion), and a payload object with URL, referrer, UTM parameters, and any custom metadata.
  3. Implement authentication. Generate an API key in the BotRefund dashboard. For webhooks, configure a secret and verify the HMAC‑SHA256 signature on every inbound call.
  4. Add idempotency keys. Every event you send must carry a unique idempotency_key (UUID v4 or a deterministic hash of session+event+sequence). BotRefund deduplicates on this key for 24 hours.
  5. Build a sandbox flow. Use the test‑mode endpoint to send synthetic events, verify the scoring response shape, and confirm webhook delivery to your staging endpoint.
  6. Run a live audit. Enable the free bot audit (no credit card) on a low‑traffic subdomain or feature flag. Review the evidence dashboard for false positives before opening to full traffic.
  7. Gradual rollout. Ramp traffic in 10 % increments, monitor webhook latency and error rates, and keep a kill‑switch to disable the integration instantly.

Key Facts from BotRefund's Documentation

FactDetailSource
Integration entry pointUniversal REST API and webhooks; no platform plugin requiredS1
Client‑side requirementOptional snippet; API‑only path needs zero browser scriptsS1, S2
Detection signals106 independent behavioral checks (ghost clicks, honeypots, pointer linearity, tremor, speed, grid‑aligned paths, engagement, session duration)S5, S7, S8
Scoring modelAI weighs full signal pattern; reported 99% accuracyS7, S8
Refund coverageGoogle and Meta ad spend; claims can reach back to 2017S2
Setup time claim"About one minute" for snippet; API integration takes engineering daysS2
Affiliate payout auditStart without platform integrations using UTM/click IDs; upload CSV or connect platform later for exact matchingS1
Evidence outputPer‑conversion tags: Approve, Review, Hold, Reject with granular behavioral evidenceS1

Typical Custom‑Stack Integration Pattern (Hypothetical Scenario)

Imagine a Node.js/Express checkout service that sits behind a Kubernetes ingress. The team decides on the pure API route to avoid any third‑party script on their PCI‑scoped pages.

  • They add a lightweight middleware that extracts gclid, fbclid, and UTM params from the inbound request, generates a session_id (or reuses their existing analytics session cookie), and fires a pageview event to BotRefund's /v1/events endpoint with an idempotency key derived from session_id:pageview:1.
  • When the user completes a purchase, the order service publishes a conversion event to their internal Kafka topic. A consumer service picks it up, enriches it with the stored click_id and session_id, and posts a conversion event to BotRefund with a new idempotency key.
  • BotRefund responds with a score (0–1) and a tag (human/bot). The consumer writes the score to their data warehouse for BI and, if the tag is bot, flags the order for manual review before fulfillment.
  • Webhooks are configured to hit https://api.internal.company/botrefund/webhook. The endpoint verifies the HMAC signature using the shared secret, checks the idempotency key against a Redis set (TTL 24 h), and updates the order record with the final refund‑claim status.
  • During the free audit period, they route 5 % of traffic via a feature flag, compare BotRefund's tags against their own heuristic rules, and tune the score threshold before full rollout.

This pattern keeps all PII and payment data inside their VPC, adds only one outbound HTTPS call per tracked event, and gives them full replayability via the idempotency keys.

Common Pitfalls and How to Avoid Them

  • Missing click IDs. Google's gclid and Meta's fbclid are stripped by some CDNs or consent managers. Capture them on the landing page and store them in a first‑party cookie or server session before any redirect.
  • Idempotency key collisions. Using a simple counter per session fails under retries. Use UUID v4 or a hash of session_id:event_type:sequence_number with a monotonically increasing sequence stored in Redis.
  • Webhook ordering. BotRefund does not guarantee delivery order. Design your consumer to be idempotent and commutative — store the latest score and tag per session_id and ignore stale events.
  • Rate limits. The API enforces per‑account limits (check your plan). Batch conversion events if you have bursty traffic, or request a higher quota before launch.
  • Test‑mode confusion. Events sent with test_mode: true never trigger refund claims. Remember to flip the flag (or use a separate API key) for production.

Limitations and When This Advice Doesn't Apply

  • If you cannot modify backend code (e.g., a hosted SaaS checkout with no webhook extensibility), the pure API path is impossible — you'd need the client‑side snippet or a tag‑manager injection.
  • If your traffic volume exceeds the API tier's rate limits and you cannot batch, you may hit throttling. Enterprise plans offer higher limits; contact sales.
  • BotRefund only disputes Google and Meta ad spend. It does not handle chargebacks, payment‑processor disputes, or non‑ad‑platform refunds.
  • The 99% accuracy figure is a platform‑wide claim; your false‑positive rate depends on your traffic mix. Always run the free audit before committing budget.
  • Affiliate payout reconciliation via CSV upload is batch‑only — not suitable for real‑time commission decisions.

Terminology Quick Reference

  • Click ID (gclid/fbclid): Unique parameter appended by Google Ads or Meta Ads to the landing‑page URL; ties a session to a paid click.
  • Idempotency key: Client‑generated unique token that lets the API safely deduplicate retries.
  • Webhook: HTTPS callback BotRefund posts when a refund claim status changes (submitted, approved, rejected, paid).
  • HMAC signature: Hash‑based message authentication code using a shared secret; verifies the webhook originated from BotRefund.
  • Score (0–1): Model output; higher means more bot‑like. Threshold for "bot" tag is configurable per account.
  • Tag: Categorical label — human, bot, or review — derived from score and rule set.
  • Evidence dashboard: UI showing per‑session behavioral signals, video‑style replay, and the Approve/Review/Hold/Reject tags for affiliate payouts.

FAQ

Do I need to add BotRefund's JavaScript snippet to use the API?

No. The snippet is optional. It automates behavioral data collection in the browser. If you use the pure REST API, you send only the events you choose from your backend.

What is the minimum event payload BotRefund accepts?

At minimum: session_id, click_id (gclid or fbclid), timestamp (ISO‑8601), event_type (pageview, click, conversion), and a payload object with url, referrer, and UTM parameters. Custom metadata is encouraged.

How long does a typical custom API integration take?

Engineering teams report 2–5 days for a clean event‑driven backend (mapping, auth, idempotency, sandbox, audit). Add time if you need to retrofit click‑ID capture on legacy landing pages.

Can I test without risking real refund claims?

Yes. Every API key has a test_mode flag. Events sent in test mode are scored and returned but never submitted to Google or Meta. The free bot audit also runs in a segregated environment.

What happens if my webhook endpoint is down?

BotRefund retries with exponential backoff for up to 72 hours. After that the event is marked failed in the dashboard; you can replay manually. Design your endpoint to be idempotent so retries are safe.

Does BotRefund work with server‑side rendering (Next.js, Nuxt, Remix)?

Yes. Capture the click IDs in getServerSideProps or middleware, store them in a cookie or session, then fire the API call from your API route or a background job after hydration.

Is there a starter kit with sample code?

BotRefund publishes a custom‑integration starter kit with Node, Python, and PHP examples covering auth, event mapping, idempotency, and webhook verification. It's linked from the developer docs and the free‑audit confirmation page.

How BotRefund Helps Custom‑Stack Teams

BotRefund gives you a universal REST API and webhook system so you can keep your proprietary stack intact — no forced plugins, no third‑party scripts on sensitive pages. You control exactly what data leaves your infrastructure, and the 106‑signal detection engine runs on BotRefund's side, so you don't need to build or maintain bot‑detection logic. The trade‑off is that you own the plumbing: authentication, schema mapping, idempotency, and webhook reliability are your responsibility. If you have an event bus or middleware layer, the lift is low; if you're starting from zero, budget a few engineering days. The free bot audit lets you validate the whole flow on real traffic before you commit.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.

Learn more