Skip to main content
POST
Records link clicks on a custom (non-Shopify) website and attributes them to campaign creators. Use it when creator links point straight at your own site, for example https://yoursite.com/?a=megan1. Shopify stores do not need this endpoint. The Growi storefront script records their clicks. Once page views are flowing, creators see Page Views and Unique Clicks on their campaign Revenue page. Brand reports that show link clicks pick them up within about 15 minutes. See Custom website click tracking for a full walkthrough.

Request body

Send one page view as a flat object, or up to 500 in a page_views array.

Behavior

  • Call it from your server. The API key must never reach the browser.
  • Unknown tags are skipped, not rejected. They are counted in unmatched and listed in unmatched_campaign_affiliate_ids.
  • Safe to retry. A page view with an explicit occurred_at is recorded once per creator, visitor_uid and occurred_at. Repeats are counted in duplicates.
  • Malformed requests record nothing. A missing visitor_uid, a missing tag, a bad date, an empty array or more than 500 page views returns 422 with one error per bad row.
  • Own rate limit. Up to 1,000 requests per hour per API key, with no 2-second wait between requests. Page views do not use up the budget of your other API calls, and your other calls do not use up this one.
  • Send people, not bots. Skip link-preview fetchers, crawlers and prefetch requests before you call the endpoint.

Response fields

The status is 201 when at least one page view was recorded and 200 when the request was valid but nothing new was recorded.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
campaign_affiliate_id
string
required

The creator's affiliate tag: the value of the a parameter on the link the visitor clicked. Not case sensitive.

visitor_uid
string
required

Your own stable, anonymous ID for the visitor (for example a first-party cookie value). Unique clicks are counted per visitor_uid.

Maximum string length: 255
occurred_at
string<date-time>

When the click happened, as an ISO 8601 date-time or a Unix timestamp in seconds. Defaults to now. Past dates are accepted, so you can backfill. Future dates are rejected.

page_path
string

Path of the landing page, for example /pricing.

page_title
string

Title of the landing page.

referrer_url
string

The page the visitor came from (document.referrer).

Response

The request was valid but nothing new was recorded (every page view was a duplicate or had an unknown tag)

success
boolean
created
integer

Page views recorded by this request

duplicates
integer

Page views skipped because the same creator, visitor_uid and occurred_at were already recorded

unmatched
integer

Page views skipped because the tag does not belong to a creator in your organization

unmatched_campaign_affiliate_ids
string[]

The tags that were not found