Webgains

Datafly Signal delivers conversions to the Webgains affiliate network server-to-server using the Webgains S2S Conversion API (the queue-conversion endpoint). Sales and leads are sent directly from your Signal deployment to Webgains, attributed by a first-party click identifier. This is immune to ad blockers, browser tracking prevention (ITP), and cookie deletion, and it preserves attribution even when JavaScript is disabled.

Prerequisites

Before configuring Webgains in Signal, you need:

  • An active Webgains advertiser account with a live program.
  • Your Program ID (a numeric ID such as 312042).
  • The Event ID for the commission event you want to record (sale and lead are typically separate event IDs).
  • The Signal collector capturing the Webgains click identifier on landing pages (see Capturing the click ID).

Program IDs and Event IDs are specific to your Webgains program. If you are unsure of yours, ask your Webgains Integration Manager.

Capturing the click ID

Webgains attributes a conversion using the click identifier that Webgains appends to the landing-page URL as the wgu query parameter when a publisher sends a visitor to your site.

Signal’s collector captures the wgu parameter on the landing page and persists it as a first-party cookie, then surfaces it on every event as vendor_ids.webgains_click_id. At conversion time, Signal reads that value and places it in the Webgains payload — no client-side Webgains tag is required.

⚠️

The click ID is the load-bearing attribution key. If it is missing at conversion time, Webgains cannot attribute the sale. Make sure the click-ID cookie lifetime covers your program’s attribution (cookie) window.

Configure in Signal

Configuration Fields

FieldRequiredDescription
program_idYesYour Webgains advertiser program ID (numeric). Found in your Webgains advertiser dashboard.
event_idYesThe Webgains commission event ID for this conversion type (e.g. sale or lead). If your program uses separate event IDs for sales and leads, create one integration per event ID.

Management UI Setup

Add the integration

Go to IntegrationsAdd IntegrationWebgains.

Choose a preset

  • RetailOrder Completed delivered as a sale with item-level basket data.
  • Lead GenerationLead Generated and Signed Up delivered as a lead.

Enter your credentials

Enter your program_id and the event_id for the chosen conversion type.

Attach and save

Attach the integration to the pipeline that emits your conversion events and click Save.

API Endpoint

POST https://api.webgains.io/queue-conversion
Content-Type: application/json

The Webgains S2S Conversion API is unauthenticated — there is no API key, token, or signature. Each request is validated by the combination of the click identifier (the s2s value inside ids) and your programId. Keep the click ID confidential; Signal handles it first-party and never exposes it client-side.

Identity Signals

Webgains matches a conversion to the originating click using the click identifier, not hashed PII.

SignalFieldDescription
Click IDids[].value (with ids[].name = s2s)The Webgains click identifier captured from the wgu URL parameter. Sent automatically by Signal from vendor_ids.webgains_click_id.
Customer IDcustomerIdYour own customer identifier (Signal maps the identified email by default). Optional.
Customer typecustomerTypenew or existing, used for new-vs-returning commission tiers. Optional.

No PII hashing is required for Webgains — attribution is click-ID based.

Event Mapping

Retail preset

Signal eventWebgains conversion
Order CompletedSale (the configured event_id)

Lead Generation preset

Signal eventWebgains conversion
Lead GeneratedLead (the configured event_id)
Signed UpLead (the configured event_id)

All other events (page views, browsing, cart actions) are dropped — Webgains is a conversion-only endpoint.

Example: Sale

Datafly.js call:

datafly.track("Order Completed", {
  order_id: "ORD123456789",
  revenue: 97.50,
  currency: "GBP",
  coupon: "",
  customer_type: "new",
  products: [
    { product_id: "TSHIRT001", name: "T-Shirt", price: 60.00 },
    { product_id: "JEANS002", name: "Jeans", price: 37.50 }
  ]
});

Webgains payload sent by Signal:

{
  "programId": "312042",
  "eventId": "1234567",
  "ids": [
    { "name": "s2s", "value": "117_1633304_16651550532817_3f4e40a2a3" }
  ],
  "value": "97.50",
  "currency": "GBP",
  "orderReference": "ORD123456789",
  "customerId": "jane.doe@example.com",
  "customerType": "new",
  "items": [
    { "name": "T-Shirt", "code": "TSHIRT001", "price": "60.00", "voucher": "" },
    { "name": "Jeans", "code": "JEANS002", "price": "37.50", "voucher": "" }
  ]
}

Testing

Generate a tracked click

Visit your site through a Webgains tracking link (or append a test wgu parameter as advised by your Integration Manager) so the click ID is captured into the first-party cookie.

Trigger a conversion

Complete a test order on your site so Signal fires Order Completed.

Verify in Webgains

Check your Webgains advertiser dashboard reporting for the test conversion. Confirm the orderReference, value, and currency match, and that the conversion is attributed (not unattributed).

Inspect the payload

Use Signal’s event debugger to confirm the outbound payload contains ids[].value (the click ID), programId, eventId, value, and currency.

Troubleshooting

ProblemSolution
Conversion not appearing in WebgainsConfirm the click ID is present on the event (vendor_ids.webgains_click_id). If it is empty, the wgu parameter was not captured or the cookie expired.
Conversion appears as unattributedThe click ID was missing or did not match a recorded click within the attribution window. Check the cookie lifetime covers your program’s cookie window.
400 errorsA required field is missing or malformed. Ensure programId, the s2s click ID, value, and currency are all present; value must be a numeric string with a period decimal (e.g. "97.50").
Wrong commission recordedCheck the event_id matches the commission event for this conversion type. Sales and leads usually use different event IDs.
New vs existing not differentiatingMap customer_type (new / returning) on your conversion event so Signal sets customerType.