Page Comparison - Enable Customer Activity Tracking (v.53 vs v.54) - EN documentation - REES46 Manual
Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


This section helps you embed visitor tracking into your online store. It is critical for further set up.

Anchor
Top
Top

Panel
titleThis page covers the following:

Table of Contents

  

Info
titleNOTE

The exact position of the JS-code snippets in your templates may vary depending on your scenario.

To clarify, consider the following example: a customer clicks the Add to Cart button and your page sends the product ID to REES46.

To realize this scenario, your HTML page may use the following code:

<input type=button value="Add to Cart" onclick="r46('track', 'cart', 37);" >

where 37 is an example of the ID of added product.


Product Page

Insert a JS-code snippet, similar to the following example, into your Product Detail page template:

Code Block
languagejs
titleSimplified mode
// where 37 - a product ID example
r46('track', 'view', 37);

Alternatively, you can use extended formatting to add and dynamically update additional product properties in our product database:

Code Block
languagejs
titleExtended mode
// ID is required. Other parameters are optional.
// If the stock parameter isn't set, its value from the product feed (XML) or import via HTTP API will be used.
r46('track', 'view', {
	id: '37',
	stock: true
	}
});

Shopping Cart Page

This section provide JS-code snippets to insert into the Shopping Cart page template to track the following events:

Adding an Item to the Cart

Insert a JS-code snippet, similar to the following example, into your Shopping Cart page template:

Code Block
languagejs
titleSimplified mode
// where 37 - an product ID example
r46('track', 'cart', 37);

Alternatively, you can use extended formatting to add and dynamically update additional product properties in our product database and track amount of SKUs (items) in the cart:
Code Block
languagejs
titleSimplified mode
// Product ID is required. Other parameters are optional (see the Note below).
r46('track', 'cart', {
    id: '37',
    amount: 3,
    stock: true,
    recommended_by: 'interesting' // read the note below
});


Info
titleNOTE

The  recommended_by parameter is mandatory if the item is added to the Cart through Product Recommendations in the Recommendation Block. Value of this parameter should correspond to the type of recommending algorithm.

Removing an Item from the Cart

Insert a JS-code snippet, similar to the following example, into your Shopping Cart page template:

Code Block
languagejs
titleSimplified mode
// where 37 - an product ID example
r46('track', 'remove_from_cart', 37);


Alternative Option (for Removing and Adding to the Cart)

If you can't track the last added to or removed from the Cart item, you can send REES46 a full list of items in the Cart using code similar to the following example: 

Code Block
languagejs
titleSimplified mode
// Product IDs are required. Other parameters are optional.
r46('track', 'cart', [
    {
        id: '37',
        amount: 3
    },
    {
        id: '43',
        amount: 1
    }
]);


Warning
titleIMPORTANT
Don't use the alternative option sending the Shopping cart content at each view of any page - it will break the trigger schedule.
Use it only for the following events: item added to the Cart, item removed from the Cart, item quantity changed.


Customer Checkout-success Page

 To enable orders tracking, insert a JS-code snippet, similar to the following example, into your Checkout-sucess page template (the "Order has been successfully processed" or "Thank you for the purchase" page):

Code Block
languagejs
titleSimplified mode
// 37 is a product ID
r46('track', 'purchase', {
    products: [
        {id: 37, price: 318, amount: 3, stock: true},
        {id: 187, price: 5000, amount: 1, stock: false}
    ],
    order: 'N318',
    order_price: 29999
});

Tables of Attributes

The following tables describes the attributes used in the above sample code:

AttributeTypeMandatory?Description
productsarrayyesAn array that specifies purchased products. See the table below for details.
ordernumber/stringnoSpecifies the order ID from your CRM. If not set, REES46 generates a temporary order ID, and, in this case, you cannot synchronize order statutes.
order_pricenumbernoPecifies the final price of the order (less all discounts). If not set, REES46 takes the standard pricing from your XML-file.
delivery_typestringnoOrder delivery method. Available values:
  • self_pickup
  • delivery
  • pickup_point


Info

If you use "one-click order" (or "order without registration") call this method without the "order" parameter.

Description of parameters in the "products" array:

AttributeTypeMandatory?Discription
idnumber/stringyesProduct ID
amountnumberyesSpecifies the amount of purchased product
pricenumberno

Specifies the price of the purchased product

If not set, REES46 takes the item price from your XML Product Feed.
NOTE: Your current XML-file can contain outdated pricing and/or contain no information on personal discounts or on-going sales, so the precalculated price can differ from the final price in your CRM.

stockbooleannoProduct availability. It may be useful when the last product is sold to immediately exclude it from the recommendations.

Category Page

Insert a JS-code snippet, similar to the following example, into your Category Detail page template:

Code Block
languagejs
titleSimplified mode
// where 50 - a category ID example
r46('track', 'category', 50);

Track search event when user performs search query:

Code Block
languagejs
titleExample
// "best smartphone" - search query
r46('track', 'search', "best smartphone");

Wishlist

Adding an Item to the Wishlist

Code Block
languagejs
titleSimplified mode
// where 37 - an product ID example
r46('track', 'wish', 37);

Removing an Item from the Wishlist

Code Block
languagejs
titleSimplified mode
// where 37 - an product ID example
r46('track', 'remove_wish', 37);


Return to the top of the page | Proceed to the next page


Panel
titleTable of Contents

Page Tree
rootManual Integration via JS SDK III

Status
colourGreen
titlefinal