Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Product View
Method Objective
The method gives the system an understanding of the product viewed by the user.
Syntax and parameters
Code Block | ||
---|---|---|
| ||
personaclick("track", "view", params); |
Name
Type
Requirement
Description
params
Object
required
Object with request parameters.
Request parameters
Name
Type
Requirement
Description
id
number/string
required
The ID of the current product.
recommended_by
string
required in some cases
This parameter should be set to "dynamic" if the current product from the recommendation block is viewed without going to the product page or the site uses a "single page" architecture.
recommended_code
string
required in some cases
Product View
Method Objective
Status | ||||||
---|---|---|---|---|---|---|
|
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "view", params); |
Name | Type | Requirement | Description |
---|---|---|---|
params | Object | required | Object with request parameters. |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
id | number/string | required | The ID of the current product. |
recommended_by | string | required in some cases | This parameter should be set to "dynamic" if the current product from the recommendation block is viewed without going to the product page or the site uses a "single page" architecture. |
recommended_code | string | required in some cases | This parameter should have a unique code for the product recommendations block if the current product from the recommendations block is viewed without going to the product page or the site uses a "single page" architecture. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "view", {
id: "100500",
recommended_by: "dynamic",
recommended_code: "c6d2fe5fdca0c8e51d10b07523bc07"
}); |
Category View
Method Objective
Status | ||||||
---|---|---|---|---|---|---|
|
Warning |
---|
The API will respond with an error for categories unknown to the system. The system only knows the categories from the product feed (XML) or the HTTP import of the category list. |
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "category", id); |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
id | number/string | required | The ID of the current category. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "viewcategory", { id: "100500", recommended_by: "dynamic", recommended_code: "c6d2fe5fdca0c8e51d10b07523bc07" }); |
Category View
Method Objective
The "146"); |
Adding a product to the cart
Method Objective
Status | ||||||
---|---|---|---|---|---|---|
|
the product added to the cart by the user.
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "categorycart", id); |
Request parameters
Name
Type
Requirement
Description
id
number/string
required
The ID of the current category.
Example of use
Code Block | ||
---|---|---|
| ||
personaclick("track", "category", "146"); |
Adding a product to the cart
Method Objective
The method gives the system an understanding of the product added to the cart by the user.
Syntax and parameters
Code Block | ||
---|---|---|
| ||
personaclick("track", "cart", params); |
Name
Type
Requirement
Description
params
Object
required
Object with request parameters.
Request parameters
Name
Type
Requirement
Description
id
number/string
required
The ID of the product added to the cart.
amount
number
optionally
The total value of the amount of product added to the cart. Default: 1.
Tip |
---|
For example:
|
recommended_by
string
required in some cases
This parameter should be set to "dynamic" if the product from the recommendation block is added to the cart without going to the product page or the site uses a "single page" architecture.
recommended_code
string
required in some cases
This parameter should have a unique code for the product recommendations block if the product from the recommendations block is added to the cart without going to the product page or the site uses a "single page" architecture. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
Example of use
Code Block | ||
---|---|---|
| ||
personaclick("track", "cart", {
id: "100500",
amount: 3,
recommended_by: "dynamic",
recommended_code: "c6d2fe5fdca0c8e51d10b07523bc07"
}); |
Removing a product from the cart
Method Objective
The method gives the system an understanding of the product removed from the cart by the userparams); |
Name | Type | Requirement | Description |
---|---|---|---|
params | Object | required | Object with request parameters. |
Request parameters
Name | Type | Requirement | Description | ||
---|---|---|---|---|---|
id | number/string | required | The ID of the product added to the cart. | ||
amount | number | optionally | The total value of the amount of product added to the cart. Default: 1.
| ||
recommended_by | string | required in some cases | This parameter should be set to "dynamic" if the product from the recommendation block is added to the cart without going to the product page or the site uses a "single page" architecture. | ||
recommended_code | string | required in some cases | This parameter should have a unique code for the product recommendations block if the product from the recommendations block is added to the cart without going to the product page or the site uses a "single page" architecture. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "cart", {
id: "100500",
amount: 3,
recommended_by: "dynamic",
recommended_code: "c6d2fe5fdca0c8e51d10b07523bc07"
}); |
Removing a product from the cart
Method Objective
Status | ||||||
---|---|---|---|---|---|---|
|
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "remove_from_cart", id); |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
id | number/string | required | The ID of the product removed from the cart. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "remove_from_cart", "100500"); |
Update the current cart
Method Objective
Status | ||||||
---|---|---|---|---|---|---|
|
Note |
---|
This method is required for use on the cart page when the user does certain actions there: when the user visits the page, changes the quantity of a product in the cart, removes a product from the cart, or clears the cart completely. |
Tip |
---|
This method can be used on the product page as an alternative to the "Add to cart" and "Remove from cart" methods if you have access to the entire cart on the product page. |
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "remove_from_cart", idparams); |
Name | Type | Requirement | Description |
---|---|---|---|
params | Object array | required | Object array with request parameters. |
Request parameters
Each object in the array can contain the following properties.
Name | Type | Requirement | Description |
---|---|---|---|
id | number/string | required | The ID of the product |
in the cart. | |||
amount | number | optionally | Quantity of the product. |
Example of use
Code Block | ||
---|---|---|
| ||
personaclick("track", "remove_from_cart", "100500"); |
Update the current cart
Method Objective
The method updates the whole cart on the system side.
Note |
---|
This method is required for use on the cart page when the user does certain actions there: when the user visits the page, changes the quantity of a product in the cart, removes a product from the cart, or clears the cart completely. |
Tip | |||
---|---|---|---|
| |||
personaclick("track", "cart", [
{
id: "100500",
amount: 3
},
{
id: "146",
amount: 1
}
]); |
Successful checkout
Method Objective
Status | ||||||
---|---|---|---|---|---|---|
|
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "cart", params);purchase", params); |
Name | Type | Requirement | Description |
---|---|---|---|
params | Object | required | Object with request parameters. |
Request parameters
Name | Type | Requirement | Description |
---|
products |
array | required |
Object array with request parameters.
Request parameters
Each object in the array can contain the following properties.
Product properties:
Name
Type
Requirement
Discription
id
number/string
required
Product ID.
amount
number
required
Product Quantity.
price
number
optionally
The unit price of the product. If not specified, the system will use the price from the product feed.
Code Block | ||
---|---|---|
| ||
personaclick("track", "purchase", {
products: [
{id: "37", price: 100, amount: 3},
{id: "187", price: 500, amount: 1}
],
order: "N100500",
order_price: 750,
order_cash: 650,
order_bonuses: 100,
order_delivery: 0,
order_discount: 50,
promocode: "BIRTHDAY",
delivery_type: "delivery",
payment_type: "cart"
}); |
Name
Type
Requirement
Description
An array of purchased products. See the table below for details. | |||
custom | object | optionally | Custom properties of the order. The properties should be pre-created: Account > Settings > Order properties The following data types are supported: - string - integer - date (YYYY-MM-DD) See example below. |
order | number/string |
optionally |
The ID of the product in the cart.
amount
number
optionally
Quantity of the product.
Example of use
Code Block | ||
---|---|---|
| ||
personaclick("track", "cart", [
{
id: "100500",
amount: 3
},
{
id: "146",
amount: 1
}
]); |
Successful checkout
Method Objective
The method gives the system information about the successful checkout, its products, and other information related to the checkout.
Syntax and parameters
Code Block | ||
---|---|---|
| ||
personaclick("track", "purchase", params); |
Name
Type
Requirement
Description
params
Object
required
Object with request parameters.
Request parameters
Name
Type
Requirement
Description
products
array
required
An array of purchased products. See the table below for details.
order
number/string
optionally
Internal store Order ID. If not specified, the system will create its internal ID. Synchronization of order statuses, in this case, won't be available.
order_price
number
optionally
The final order value, including all discounts. If not specified, the system will calculate the order value based on prices from the product feed.
order_cash
number
optionally
The amount of money the user spent to pay for the order.
order_bonuses
number
optionally
The number of bonuses the user spent to pay for the order.
order_delivery
number
optionally
Shipping cost.
order_discount
number
optionally
Discount amount (in money).
promocode
string
optionally
Promo code that was used.
Tip |
---|
If a promo code from the list uploaded to the account has been used, it'll be marked as used. |
delivery_address
string
optionally
Delivery address. Any text.
delivery_type
string
optionally
Delivery Type, e.g. "courier", "self_pickup", "delivery", "pickup_point", etc.
payment_type
string
optionally
Payment method. Any string value. For example: "cash", "card", "wire".
tax_free
boolean
optionally
It sets whether the order was placed with Tax-Free or not.
Internal store Order ID. If not specified, the system will create its internal ID. Synchronization of order statuses, in this case, won't be available.
| |||||
order_price | number | optionally | The final order value, including all discounts. If not specified, the system will calculate the order value based on prices from the product feed. | ||
order_cash | number | optionally | The amount of money the user spent to pay for the order. | ||
order_bonuses | number | optionally | The number of bonuses the user spent to pay for the order. | ||
order_delivery | number | optionally | Shipping cost. | ||
order_discount | number | optionally | Discount amount (in money). | ||
promocode | string | optionally | Promo code that was used.
| ||
delivery_address | string | optionally | Delivery address. Any text. | ||
delivery_type | string | optionally | Delivery Type, e.g. "courier", "self_pickup", "delivery", "pickup_point", etc. | ||
payment_type | string | optionally | Payment method. Any string value. For example: "cash", "card", "wire". | ||
tax_free | boolean | optionally | It sets whether the order was placed with Tax-Free or not. |
Product properties:
Name | Type | Requirement | Discription |
---|---|---|---|
id | number/string | required | Product ID. |
amount | number | required | Product Quantity. |
price | number | optionally | The unit price of the product. If not specified, the system will use the price from the product feed. |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "purchase", {
products: [
{id: "37", price: 100, amount: 3},
{id: "187", price: 500, amount: 1}
],
"custom": {
"order_comment": "Delivery after 15:00, 2nd floor, apt. 222",
"boxes": 2,
"refund_date": "2021-09-21"
},
order: "N100500",
order_price: 750,
order_cash: 650,
order_bonuses: 100,
order_delivery: 0,
order_discount: 50,
promocode: "BIRTHDAY",
delivery_type: "delivery",
payment_type: "cart"
}); |
Search Request
Method Objective
The method gives the system an understanding of the user's search queries.
Warning |
---|
The event must be used on the search results page and must send the complete search phrase as the value. Don't use this to send every character entered, but only the complete search phrase. |
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "search", search_query); |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
search_query | string | required | Search query phrase. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "search", "to be or not to be"); |
Adding a product to the wishlist
Method Objective
The method gives the system an understanding of the user's search queries.
the user has added a product to the wishlist.
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "searchwish", search_queryid); |
Request parameters
Name | Type | Requirement | Description |
---|
id | number/string | required |
The ID of the product added to the wishlist. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "search", "to be or not to be", "wish", "100500"); |
Removing a product
tofrom the wishlist
Method Objective
The method gives the system an understanding the user has added removed a product to from the wishlist.
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "remove_wish", id); |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
id | number/string | required | The ID of the product |
removed from the wishlist. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "remove_wish", "100500"); |
Update the current wishlist
Method Objective
The method gives the system an understanding the user has removed a product from the wishlistupdates the whole wishlist on the system side.
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "remove_wish", idids); |
Name | Type | Requirement | Description |
---|
ids |
Array | required |
Array with wish list product IDs.
|
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
| ||||
// synchronizing a wishlist personaclick("track", "remove_wish", ["100500", "146"]); // clearing a wishlist personaclick("track", "wish", []); |
Custom Event
Method Objective
The method gives the system an understanding that some user event has happened.
Note |
---|
Before you can use custom events, you must create them in the PersonaClick account: Settings > Custom events. |
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", custom_event_key, params); |
Name | Type | Requirement | Description |
---|---|---|---|
custom_event_key | string | required | Unique custom event key. Must be pre-created in the PersonaClick account: Settings > Custom events. |
params | Object | optionally | Object with request parameters. |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
category | string | optionally | A category is a name that you supply as a way to group some event's properties. |
label | string | optionally | With labels, you can provide additional information for events that you need. |
value | number | optionally | The value property can be any integer and can be used to send a specific value in an event. |
Examples of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "my_event"); |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("track", "my_event", { category: "my_category", label: "my_label", value: 100500 }); |
Column | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Page Navigation
Related Pages
|