The exchange of information between the customer’s e-commerce site and the Blendee platform takes place through non-blocking asynchronous tracking scripts to be installed on the e-commerce site itself.
In order for this exchange to take place correctly, the following script must be inserted on each page of the website (preferably in the head section):
Values written in italics in curly brackets are placeholders to be set as follows (values entered must produce valid javascript code):
Each different type of event to be tracked has specific parameters and above all must be used in the right context, to ensure that the data that reaches Blendee is usable effectively for the customer.
If an event has no parameters, you can specify parameter 0 or specify no parameter after the event name. For example, the two javascript statements are equivalent:
_sbnaq.push(["trkPageView", 0]) _sbnaq.push(["trkPageView"])
Events to be traced can also be provided via Javascript direct call by invoking the event name on the Sbntrk object. For example, see the following code:
if (Sbntrk) { Sbntrk.trkProductSale( 'GRP005', '2', '', '50.00', '60.00', '5.00', 'EUR', 0, 1, '2015-10-12T10:20:20' ); }
However, this code is equivalent to the following, which is always usable:
_sbnaq.push(["trkProductSale",'GRP005','2','','50.00','60.00','5.00','EUR ',0,1,'2015-10-12T10:20:20']);
The following is the list of events that can be used (the order of the parameters must be respected):
Event Name | Context | Parameters | Parameter description |
trkPageView | Generic event to track the view of a page | – | – |
trkCategoryView | Event to be included in the page dedicated to a product category | categoryId | Identifier of the current Category (must match the data provided on CSV flows). |
trkProductView | An event to be provided on a product detail page. | productId [, categoryId, brand] | Identifier of the displayed product (must match the data provided on CSV flows). Optional: categoryId: product categorybrand: brand name of the product |
trkProductBasketAdd | An event to be provided when the user adds a product to their cart. | Productid | Identifier of the product added to the cart (must match the data provided on the CSV flows). |
[cartId] | Identifier of the current cart. Optional. | ||
trkProductBasketRemove | An event to be provided when the user removes a product from their cart. | Productid | The identifier of the product removed from the cart (must match the data provided on the CSV flows). |
[cartId] | Identifier of the current cart. Optional. | ||
trkProductSale | Event to be provided when the user places a purchase order for one or more products | groupNumber | Alphanumeric identifier of the order placed. This data is the element that groups together several products purchased at the same time. |
Productid | Identifier of the product added to the cart (must match the data provided on the CSV flows). | ||
quantity | Purchased quantity (integer value greater than or equal to 1). | ||
coupon | Code of any coupon used by the user. In the case of multiple products in the same order, it can only be supplied once. | ||
Price | Amount of the product purchased, without VAT or equivalent taxes. | ||
priceWithTax | Amount of the product with VAT or equivalent taxes. | ||
deliveryPrice | Shipping costs. In the case of multiple products in the same order, it can only be supplied once. | ||
currency | Currency (ISO 4217 (http://it.wikipedia.org/wiki/ISO_4217) standard). | ||
Ts | Timestamp of the purchase in the format YYYY-MM-DDTHH:mm:SS | ||
Expiration | Expiration date of the purchased item. Optional. If provided, it must have the format YYYY-MM-DD | ||
trkProductsSale | Alternative event to trkProductSale that allows you to record the purchase of multiple products in a single call | productsArray | Arrays of objects containing the fields used in the trkProductSale call. ES: [[‘GRP005’, ‘2’, ‘1’, ”, ‘50.00’, ‘60.00’, ‘5.00’, ‘EUR’, ‘2015-10-12T10:20:20’], [‘GRP005’, ‘4’, ‘2’, ”, ‘30.00’, ‘60.00’, ‘0.00’, ‘EUR’, ‘2015-10-12T10:20:20’]] |
trkProductLocalSearch | Search the customer’s site by a user | Kw | Keyword used by the user. |
trkUserRegistration | Registering a new user | userId | Identifier of the user registered on the site. This value must match the value provided on the users’ CSV flow. |
[email] | Email address of the user who is registering. Optional. | ||
trkNewsletterSubscription | Newsletter registration of a new user | [Email]* | string, required field, |
[Nome] | string, field NOT required | ||
[Cognome] | string, field NOT required | ||
[f_ricevi_newsletter]* | Boleano, required field | ||
[f_ricevi_comunicazioni_commerciali]* | Boleano, required field | ||
[Lista_email] | string, NOT mandatory field, Email List Code, to be valued if you want to subscribe a user to an email list | ||
[double_optin] | boleano, mandatory field, to always be set to 1 to ensure the sending of the double optin | ||
trkNewsletterUnsubscribe | Unsubscribe a user from the newsletter | [email]* | String, required field. |
Thanks for contributing!