Demographic targeting with DealSpot

We can customize DealSpot 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 DealSpot, pass us the following parameters:

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)

To use demographic targeting with DealSpot, pass us the following 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. Assign the JSON string to a new tp_params parameter.
  3. 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}

And here’s the string assigned to a new tp_params parameter:

<span id="trialpay_dealspot"></span>

<script type="text/javascript" src="https://s-assets.tp-cdn.com/static3/js/api/payment_overlay.js"></script>

<script type="text/javascript">
 TRIALPAY.social.render_dealspot_swf(
   {
     "id" : "trialpay_dealspot",
     "mode" : "tpdirect",
     "vic" : "9aab51b69fb2b9fa8ab446663a0e2072",
     "onOfferUnavailable" : "TRIALPAY.social.delete_dealspot_swf",
     "tp_params" : '{"sid":"abc123DEF","tp_gender":2,"tp_age_group":2,"timestamp":1341949937}',
     "tp_signature" : ""
   });
</script>

HMAC SHA256 Hash

You must sign the tp_params value 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 in your integration code snippet.

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

<span id="trialpay_dealspot"></span>

<script type="text/javascript" src="https://s-assets.tp-cdn.com/static3/js/api/payment_overlay.js"></script>

<script type="text/javascript">
 TRIALPAY.social.render_dealspot_swf(
   {
     "id" : "trialpay_dealspot",
     "mode" : "tpdirect",
     "vic" : "<vic>",
     "onOfferUnavailable" : "TRIALPAY.social.delete_dealspot_swf",
     "tp_params" : '{"sid":"abc123DEF","tp_gender":2,"tp_age_group":2,"timestamp":1341949937}',
     "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+