Demographic Targeting with the Offer Wall

We can customize the Offer Wall to only show age- and gender-specific offers to each of your customers. For example, a 23 year old male will only see offers that have been targeted for males in the 18-24 age group.

Required Parameters (Case-Sensitive)

To use demographic targeting with the Offer Wall, pass us the following case-sensitive parameters in your integration code snippet.

Parameter Sample Value Description
sid abc123DEF A unique ID that identifies the customer. This should be the same as the top-level sid parameter in your integration code snippet. Note: SID must not exceed 220 characters in length.
tp_gender 2 The customer’s gender (see Gender Table below).
tp_age_group 2 The customer’s age group (see Age Group Table below).
timestamp 1341949937 UNIX timestamp of the current time (number of seconds since UNIX Epoch).

Optional Parameters (Case-Sensitive)

We support the following optional, case-sensitive parameters.

Parameter Sample Value Description
tp_age 26 The customer’s exact age. If you pass us this parameter you do not need to pass us
tp_age_group. If you pass us both parameters, we will use the tp_age_group value.
custom_param uvwXYZ A custom parameter and value. You can pass us any custom parameters and values that you wish.

To pass us these parameters:

  1. Format the parameters and values in JSON.
  2. URL-encode the JSON string.
  3. Assign the string to a new tp_params parameter.
  4. Append the parameter and value to the end of your integration code snippet.
  5. Sign the parameter value with an HMAC SHA256 hash.

For example, here’s a JSON formatted string using a few of the samples values from the tables above:

{"sid":"abc123DEF","tp_gender":2,"tp_age_group":2,"timestamp":1341949937}

Here’s the same string, URL-encoded:

%7b%22sid%22%3a%22abc123DEF%22%2c%22tp_gender%22%3a2%2c%22tp_age_group%22%3a2%2c%22timestamp%22%3a1341949937%7d

And here it is appended to the end of an integration code snippet’s src URL using a new tp_params parameter:

<script type="text/javascript" src="http://www.trialpay.com/dispatch/8f14d4053c1bc6664f6c8cd1928803ed?tp_params=%7b%22sid%22%3a%22abc123DEF%22%2c%22tp_gender%22%3a2%2c%22tp_age_group%22%3a2%2c%22timestamp%22%3a1341949937%7d"></script>

HMAC SHA256 Hash

You must sign the JSON formatted string — before URL-encoding — with an HMAC SHA256 hash using your scripting language’s hashing algorithm and your shared key (available in the merchant panel). Assign the hash to a new tp_signature parameter and append it to the end of the integration code snippet’s src URL.

For example (with 48025295f7 as the shared key):

<script type="text/javascript" src="http://www.trialpay.com/dispatch/8f14d4053c1bc6664f6c8cd1928803ed?tp_params=%7b%22sid%22%3a%22abc123DEF%22%2c%22tp_gender%22%3a2%2c%22tp_age_group%22%3a2%2c%22timestamp%22%3a1341949937%7d&tp_signature=3c9790b363b0c22777de65f10f180c4b25e97de9c406dae33b825caaa09da4c6"></script>

Gender Table

Value Sex
0 Unknown
1 Female
2 Male

Age Group Table

Value Age
0 Unknown
1 13-17
2 18-24
3 25-34
4 35-44
5 45-54
6 55-64
7 65+