Configuration parameters

Parameter

Type

Purpose

partnerId

String

Your Thanks-provided partner id

statusText

String

The message to display on the Thanks splash screen.

embeddedInto

HTMLElement | HTMLElement[]

Providing a HTML element here will enable the embedded Thanks widget (as opposed to the pop-up style widget). The embedded widget will be loaded into the provided element. If using multiple slots on a single page, an array of HTMLElements should be passed.

ui

{ eventName?: string, orderNumber?: string }

Let's you provide copy that may be used in Thanks UI elements. For example, "Order XYZ is on the way!"

slot

String

Defines a size constraint for a embedded block.

email

String | ((factory: {encode: ( email: string | undefined, ) => Promise<string | undefined>;}) => Promise<string | undefined>)

The customer email. This is hashed and then used for ad matching, and in cases where the customer must be sent a communication we can use it for autofill.

Note: if this field is included then onPersonalInformationRequest is required.

emailHash

{ sha256: String }

The pre-hashed version of the customer email. Used only to exclude/include the customer from ads they have seen before.

allowLocalStorage

Boolean

Allows Thanks to store information on publisher's site.

enabledPersonalInformationSubjects

{ relevance?: Boolean, autofill?: Boolean, notification?: Boolean }

A list of PII subjects that you would like to opt in to. This provides a backwards compatible way for us to introduce new subjects.

onPersonalInformationRequest

(subject: 'relevance' | 'notification' | 'autofill', { token: string, advertiser?: string, offerType?: 'coupon' | 'subscription' | 'transaction' })' => Promise<PersonalInformation>

A callback to handle PII requests. Note: this field is required if a field like customer email is included. See below for an example payload and refer to Customer data for more information.

customerLocation

{ country?: 'US' | 'AU', postcode?: string }

The customer's home location. See User Data for more information.

purchaseLocation

{ country?: 'US' | 'AU', postcode?: string }

The customer's purchase location. See User Data for more information.

traceId

String

An id enabling you to track widget activity.

keywords

String[]

A set of keywords related to this activity.

categories

String[]

A set of categories related to this activity.

items

Record<string, string|number|boolean>[]

A set of items purchased during this activity. See below for an example payload. See items below for more info

style

{ zIndex?: number }

Style overrides for the Thanks widget.

offsetTop

() => number

A callback that provides the pixel value to offset the widget from the top of the screen. Defaults to 70px.

onDisplay

() => void

A callback that will be called when the widget displays.

onClose

() => void

A callback that will be called when the widget is closed.


Examples

onPersonalInformationRequest

We can also accept additional properties, please contact Thanks if you have additional properties you wish to pass in.

{
  email: "[email protected]",
  firstName: "Emma",
  lastName: "Jackson",
  phoneNumber: "+12025550125",
  dateOfBirth: "2000-09-15",
  age: 25,
  gender: "female"
};

items

Cart items can have any properties you wish to send, as an example:

{
  name: "Colourful stacking glass set",
  category: "gifts",
  value: 49.95,
  currency: "USD",
  quantity: 1
	premium: true

}

However you may have additional properties as you wish.