Sign in

Audience Targeted by Period

GET https://{organization}.myguper.com/api/loyalty/report/audience/{start}/{end}

Who the campaigns were addressed to in a date window — the denominator behind "of the people we aimed at, how many actually got the reward".

Cards tells you how many rewards were created. It does not tell you how many people the campaign tried to reach to get there. This endpoint is the other half: divide one by the other and you get the answer.

The work it does for you is that the audience lives in three different tables, one per trigger, with three different units. Everything comes back in people:

Trigger Source One row is
audience-list the campaign audience one person
reactivate-reward the reactivation queue one customer
last-chance the last-chance queue one card × campaign

Last chance is the trap: its queue is keyed by the expiring card, not by the person, so one customer with three expiring cards produces three rows. Counting rows there inflates the audience by more than double and halves any rate built on it. This endpoint deduplicates it for you.

Two numbers come back, and only one of them is a denominator:

  • targeted — distinct people within each campaign, summed. This is what pairs with rewards granted, because a reward is also created per (campaign, person): someone in two campaigns counts twice on both sides of the division.
  • clients — distinct people across the trigger. It answers "how many people did we reach", and must never be used as a denominator.

Triggers with no audience do not appear here, on purpose. form-submission and external-events start from something the customer did — nobody was addressed. Adding their rewards to a denominator that does not exist drops the rate for no reason. meta.triggers lists what is covered.

Note there is no birthday trigger. Birthday campaigns exist, but they are built as an audience list, so they come back in that bucket.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header. Endpoints that support a Public mode (e.g. acúmulo and resgate previews) accept the same request without the header — Private mode adds customer data and a confirmation token to the response.

Headers

Name Type Description
x-guper-authorization * string User token issued by Guper. Omit only on endpoints that explicitly support a Public mode.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Path parameters

Name Type Description
start * string First day of the window, `YYYY-MM-DD`, inclusive.
end * string Last day of the window, `YYYY-MM-DD`, inclusive. The window runs on when the person entered the list or queue.

Query parameters

Name Type Description
type string Campaign type. **Pass `monetary` for any rate**: a `notification` campaign can use an audience list — it addresses people and never creates a reward, by design.
campaign string Comma-separated campaign ids. Omit for every campaign in the window.
groupBy string Which breakdowns to return: `trigger`, `campaign`, or both (the default).

Responses

Related

Copied to clipboard