# SDK Method Signatures
Below are details on the SDK's available methods with their signatures.
Important!
All numeric values must be formatted as float or int values without thousands separator, and with a decimal point (".").
For example, the price one thousand Euros and fifty cents
, must be formatted as 1000.50 and the amount twelve units
should be formatted as 12.
Product events support sending one or more pricing channels as an array. You should use that field to send the current pricing channel,
along with any additional channels you wish to count product views for. For example, if you want to use views from your online
channel
in your offline
channel. Otherwise, please send only the current pricing channel.
Confirmation events support sending a single pricing channel as a string. Unlike product events, where sending multiple pricing channels
is supported, confirmation events support sending a single channel only, on the channel
field.
Pricing channels is an optional feature. If your QL configuration is not set up for omni-channels, you do not have to send the pricing channel(s) along with your SDK events.
See the Multiple Pricing Channels guide for more information about omni-channel support.
# sendProductEvent
- productId [String] - unique product identifier
- args [Object] - event arguments:
- price [Float]* - product shelf price
- permalink [String]* - product URL on your store
- tags [Array] - optional tags for this event
- channels [Array] - optional pricing channels for this event
// without tags & channels
QL.sendProductEvent(productId, {
price: shelfPrice,
permalink: permalink
});
// with tags & channels
QL.sendProductEvent(productId, {
price: shelfPrice,
permalink: permalink,
tags: ['returning', 'mobile', 'promotion-october'],
channels: ['uk']
});
Please Note
- price is a required field.
- permalink is a required field.
- tags is an optional field and can only include strings.
- channels is an optional field and can only include strings.
# sendConfirmationEvent
- productId [String] - unique product identifier
- args [Object] - event arguments:
- price [Float]* - product sale price
- units [Int]* - optional number of sold units
- tags [Array] - optional tags for this event
- channel [String] - optional pricing channel for this event
// without tags & channels
QL.sendConfirmationEvent(productId, {
price: salePrice
});
// with tags & channels
QL.sendConfirmationEvent(productId, {
price: salePrice,
units: 2,
tags: ['returning', 'mobile', 'promotion-october'],
channel: 'uk'
});
Please Note
- price is a required field.
- units is an optional field and can contain only whole numbers.
- tags is an optional field and can only include strings.
- channel is an optional field and can only include a single string.