Versions Compared

Key

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

Product View

Method Objective

Status
colourYellow
titlerequired
 The method gives the system an understanding of the product viewed by the user.

Syntax and parameters

Code Block
languagejava
themeFadeToGrey
Params view = new Params();
view
    .put(new Params.Item(product_id))
    .put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.RECOMMENDATION{type}, recommedertype_codevalue));
PersonaClick.track(Params.TrackEvent.VIEW, view);

recommender_code

This parameter can contain one of the values:

This parameter should have a unique code of the product recommendations block if the block. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
  • This parameter should have a search query in the value if the product is viewed from the Instant or Full Search tool.
  • NameTypeRequirementDescription
    product_idstringrequiredThe ID of the current product
    {type}stringrequired is some cases

    Types of recommendation source. Available values (case sensitive):

    • RECOMMENDATION - if the currently viewed product is from the recommendations

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    Params view = new Params();
    view
        .put(new Params.Item("100500"))
        .put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.RECOMMENDATION, "b934b6ba2eb6202b8922d6a3fb8b3271"));
    PersonaClick.track(Params.TrackEvent.VIEW, view);

    Category View

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system an understanding of the category viewed by the user.

    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
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.CATEGORY, (new Params()).put(Params.Parameter.CATEGORY_ID, category_id));
    NameTypeRequirementDescriptioncategory_idstringrequiredThe ID of the current category.

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.CATEGORY, (new Params()).put(Params.Parameter.CATEGORY_ID, "146"));

    Adding a product to the cart

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system an understanding of the product added to the cart by the user.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    Params cart = new Params(); cart
    • widget
    • INSTANT_SEARCH - if the currently viewed product is from the Instant Search widget
    • FULL_SEARCH - if the currently viewed product is from the Full Search page
    type_valuestringrequired is some cases

    This parameter can contain one of the values:

    • This parameter should have a unique code of the product recommendations block if the currently viewed product is from the recommendations block. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
    • This parameter should have a search query in the value if the product is viewed from the Instant or Full Search tool.

    Examples of use

    Code Block
    languagejava
    themeFadeToGrey
    // from a recommender widget
    Params view = new Params();
    view
        .put(new Params.Item("100500"))
        .put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.RECOMMENDATION, "b934b6ba2eb6202b8922d6a3fb8b3271"));
    PersonaClick.track(Params.TrackEvent.VIEW, view);
    
    // from the Instant Search
    Params view = new Params();
    view
    	.put(new Params.Item(product_id"146"))
    		.set(Params.Item.COLUMN.FASHION_SIZE, fashion_size)
    		.set(Params.Item.COLUMN.AMOUNT, amount)
    	)
    	.put.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.RECOMMENDATIONINSTANT_SEARCH, recommender_code"shoes"));
    PersonaClick.track(Params.TrackEvent.CARTVIEW, cart);
    Name
    view);
    
    // from the Full Search
    Params view = new Params();
    view
    	.put(new Params.Item("1978"))
    	.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.FULL_SEARCH, "jacket"));
    PersonaClick.track(Params.TrackEvent.VIEW, view);



    Category View

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system an understanding of the category viewed by the user.

    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
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.CATEGORY, (new Params()).put(Params.Parameter.CATEGORY_ID, category_id));

    NameTypeRequirementDescription
    category_idstringrequiredThe ID of the current category.

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.CATEGORY, (new Params()).put(Params.Parameter.CATEGORY_ID, "146"));



    Adding a product to the cart

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system an understanding of the product added to the cart by the user.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    Params cart = new Params();
    cart
    	.put(new Params.Item(product_id)
    		.set(Params.Item.COLUMN.AMOUNT, amount)
    	)
    	.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.{type}, type_value));
    PersonaClick.track(Params.TrackEvent.CART, cart);

    NameTypeRequirementDescription
    product_idstringrequiredThe ID of the product added to the cart
    amountstringoptionally

    The total value of the amount of product added to the cart. Default: 1.

    Tip

    For example:

    1. A user has added the current product to the cart in the amount of 3 pieces. The request should have the "amount" value of 3.
    2. Then the user decides to add 2 more pieces of the current product (bringing the total to 5). The second request should have the "amount" value of 5.


    {type}stringrequired in some cases

    Types of recommendation source. Available values (case sensitive):

    • RECOMMENDATION - if the currently added to cart product is from the recommendations widget
    • INSTANT_SEARCH - if the currently added to cart product is from the Instant Search widget
    • FULL_SEARCH - if the currently added to cart product is from the Full Search page

    type_value


    stringrequired in some cases

    This parameter can contain one of the values:

    • This parameter should have a unique code of the product recommendations block if the currently added to cart product is from the recommendations block. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
    • This parameter should have a search query in the value if the product is added to cart from the Instant or Full Search tool.

    Examples of use

    Code Block
    languagejava
    themeFadeToGrey
    // from a recommender widget
    Params cart = new Params();
    cart
    	.put(new Params.Item("100500")
    		.set(Params.Item.COLUMN.AMOUNT, 2)
    	)
    	.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.RECOMMENDATION, "b934b6ba2eb6202b8922d6a3fb8b3271"));
    PersonaClick.track(Params.TrackEvent.CART, cart);
    
    // from the Instant Search
    Params cart = new Params();
    cart
    	.put(new Params.Item("146")
    		.set(Params.Item.COLUMN.AMOUNT, 3)
    	)
    	.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.INSTANT_SEARCH, "shoes"));
    PersonaClick.track(Params.TrackEvent.CART, cart);
    
    // from the Full Search
    Params cart = new Params();
    cart
    	.put(new Params.Item("1978")
    		.set(Params.Item.COLUMN.AMOUNT, 1)
    	)
    	.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.FULL_SEARCH, "jacket"));
    PersonaClick.track(Params.TrackEvent.CART, cart);



    Removing a product from the cart

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system an understanding of the product removed from the cart by the user.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_CART, product_id);

    NameTypeRequirementDescription
    product_idstringrequiredThe ID of the product
    added to
    removed from the cart
    amount

    Example of use

    string
    Code Block
    optionally

    The total value of the amount of product added to the cart. Default: 1.

    Tip

    For example:

    1. A user has added the current product to the cart in the amount of 3 pieces. The request should have the "amount" value of 3.
    2. Then the user decides to add 2 more pieces of the current product (bringing the total to 5). The second request should have the "amount" value of 5.
    fashion_sizestringoptionallyThe parameter allows specifying the size of the product related to the Apparel & Accessories niche.recommender_codestringrequired in some cases

    This parameter can contain one of the values:

    • This parameter should have a unique code of the product recommendations block if the currently viewed product is from the recommendations block. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
    • This parameter should have a search query in the value if the product is viewed from the Instant or Full Search tool.

    Example of use

    Code Block
    java
    languagelanguagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_CART, "100500");


    Update the current cart

    Method Objective

    Status
    colourYellow
    titlerequired
     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

    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
    languageapplescript
    themeFadeToGrey
    Params full_cart = new Params();
    full_cart
    	.put(new Params.Item("100500") 		.set(Params.Item.COLUMN.FASHION_SIZE, "M") 		.setput(Params.Item.COLUMN.AMOUNTParameter.FULL_CART, 2true)
       	) 	.put(new Params.RecommendedBy(Params.RecommendedBy.TYPE.RECOMMENDATION, "b934b6ba2eb6202b8922d6a3fb8b3271"));
    PersonaClick.track(Params.TrackEvent.CART, cart);

    Removing a product from the cart

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system an understanding of the product removed from the cart by the user.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_CART, product_id);
    NameTypeRequirementDescriptionproduct_idstringrequiredThe ID of the product removed from the cart

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    Item(product_id)
            .set(Params.Item.COLUMN.AMOUNT, amount)
        )
        .put(new Params.Item(product_id)
            .set(Params.Item.COLUMN.AMOUNT, amount)
        );
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_CART, "100500");

    Update the current cart

    Method Objective

    StatuscolourYellowtitlerequired 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

    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
    full_cart);


    NameTypeRequirementDescription
    product_idstringrequiredThe ID of the product added to the cart
    amountstringoptionallyQuantity of product. Default: 1.

    Example of use

    Code Block
    languageapplescript
    themeFadeToGrey
    Params full_cart = new Params();
    full_cart
        .put(Params.Parameter.FULL_CART, true)
        .put(new Params.Item(product_id"146")
            .set(Params.Item.COLUMN.AMOUNT, amount)
            .set(Params.Item.COLUMN.FASHION_SIZE, fashion_size)
        )
        .put(new Params.Item(product_id 2)
        )
        .setput(new Params.Item.COLUMN.AMOUNT, amount("100500")
            .set(Params.Item.COLUMN.FASHION_SIZEAMOUNT, fashion_size3)
        );
    PersonaClick.track(Params.TrackEvent.CART, full_cart);
    NameTypeRequirementDescriptionproduct_idstringrequiredThe ID of the product added to the cartamountstringoptionallyQuantity of product. Default: 1.fashion_sizestringoptionallyThe parameter allows specifying the size of the product related to the Apparel & Accessories niche.Example of use
    .CART, full_cart);



    Successful checkout

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system information about the successful checkout, its products, and other information related to the checkout.

    Syntax and parameters

    Code Block
    languageapplescriptjava
    themeFadeToGrey
    Params full_cartpurchase = new Params();
    full_cart
        
    purchase
    	.put(new Params.Item(product_id).set(Params.Item.COLUMN.AMOUNT, amount).set(Params.Item.COLUMN.PRICE, price))
    	.put(Params.Parameter.FULLORDER_CARTID, trueorder_id)
        	.put(new Params.Item("146")
       Params.Parameter.ORDER_PRICE, order_price)
        .setput(Params.Item.COLUMN.AMOUNTParameter.DELIVERY_ADDRESS, 2)
       delivery_address)
        .setput(Params.ItemParameter.COLUMN.FASHIONDELIVERY_SIZETYPE, "XL")
     delivery_type)
      )     .put(new Params.Item("100500")
     .Parameter.PROMOCODE, promocode)
          .setput(Params.Item.COLUMN.AMOUNT, 3)
       Parameter.PAYMENT_TYPE, payment_type)
        .setput(Params.ItemParameter.COLUMN.FASHIONTAX_SIZEFREE, "XS")
        )tax_free);
    PersonaClick.track(Params.TrackEvent.CART, full_cart);

    Successful checkout

    Method Objective

    Status
    colourYellow
    titlerequired
     The method gives the system information about the successful checkout, its products, and other information related to the checkout.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    Params purchase = new Params();
    purchase
    	.put(new Params.Item(product_id).set(Params.Item.COLUMN.AMOUNT, amount).set(Params.Item.COLUMN.PRICE, price))
    	.put(Params.Parameter.ORDER_ID, order_id)
    	.put(Params.Parameter.ORDER_PRICE, order_price)
        .put(Params.Parameter.DELIVERY_ADDRESS, delivery_address)
        .put(Params.Parameter.DELIVERY_TYPE, delivery_type)
        .put(Params.Parameter.PROMOCODE, promocode)
        .put(Params.Parameter.PAYMENT_TYPE, payment_type)
        .put(Params.Parameter.TAX_FREE, tax_free);
    PersonaClick.track(Params.TrackEvent.PURCHASE, purchase);

    Request parameters

    NameTypeRequirementDescriptionproduct_idstringrequiredProduct IDamountnumberrequiredProduct quantitypricenumberoptionallyProduct priceorder_idstringoptionallyInternal 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_pricenumberoptionallyThe final order value, including all discounts. If not specified, the system will calculate the order value based on prices from the product feed.delivery_addressstringoptionallyDelivery address. Any text.delivery_typestringoptionallyDelivery Type, e.g. "courier", "self_pickup", "delivery", "pickup_point", etc.promocodestringoptionally

    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.

    payment_typestringoptionallyPayment method. Any string value. For example: "cash", "card", "wire".tax_freebooleanoptionallyIt sets whether the order was placed with Tax-Free or not.Example of use
    PURCHASE, purchase);

    Request parameters

    NameTypeRequirementDescription
    product_idstringrequiredProduct ID
    amountnumberrequiredProduct quantity
    pricenumberoptionallyProduct price
    order_idstringoptionally

    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.

    Note

    Please note that order IDs in UUID format aren't displayed in the dashboard. Instead of UUDI, "---" will be displayed. To avoid this, add any prefix to this.


    order_pricenumberoptionallyThe final order value, including all discounts. If not specified, the system will calculate the order value based on prices from the product feed.
    delivery_addressstringoptionallyDelivery address. Any text.
    delivery_typestringoptionallyDelivery Type, e.g. "courier", "self_pickup", "delivery", "pickup_point", etc.
    promocodestringoptionally

    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.


    payment_typestringoptionallyPayment method. Any string value. For example: "cash", "card", "wire".
    tax_freebooleanoptionallyIt sets whether the order was placed with Tax-Free or not.

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    Params purchase = new Params();
    purchase
    	.put(new Params.Item("37").set(Params.Item.COLUMN.AMOUNT, 3).set(Params.Item.COLUMN.PRICE, 140.55))
    	.put(new Params.Item("187").set(Params.Item.COLUMN.AMOUNT, 1).set(Params.Item.COLUMN.PRICE, 328.35))
    	.put(Params.Parameter.ORDER_ID, "N100500")
    	.put(Params.Parameter.ORDER_PRICE, 750)
    	.put(Params.Parameter.PROMOCODE, "BIRTHDAY")
    	.put(Params.Parameter.DELIVERY_TYPE, "delivery")
    	.put(Params.Parameter.PAYMENT_TYPE, "cart");
    PersonaClick.track(Params.TrackEvent.PURCHASE, purchase);



    Search Request

    Method Objective

    The method gives the system an understanding of the user's search queries.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    Params purchase = new Params();
    purchase
    	.put(new Params.Item("37").set(Params.Item.COLUMN.AMOUNT, 3).setPersonaClick.track(Params.ItemTrackEvent.COLUMN.PRICESEARCH, 140.55))
    	 new Params().put(new Params.Item("187").set(Params.Item.COLUMN.AMOUNT, 1).set(Params.Item.COLUMN.PRICE, 328.35))
    	.put(Params.Parameter.ORDER_ID, "N100500")
    	.Parameter.SEARCH_QUERY, search_query));

    Request parameters

    NameTypeRequirementDescription
    search_querystringrequiredSearch query phrase.

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.SEARCH, new Params().put(Params.Parameter.ORDERSEARCH_PRICE, 750)
    	.put(Params.Parameter.PROMOCODE, "BIRTHDAY")
    	.put(Params.Parameter.DELIVERY_TYPE, "delivery")
    	.put(Params.Parameter.PAYMENT_TYPE, "cart");
    QUERY, "to be or not to be"));



    Adding a product to the wishlist

    Method Objective

    The method gives the system an understanding the user has added a product to the wishlist.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.WISH, product_id);

    NameTypeRequirementDescription
    product_idstringrequiredThe ID of the product added to the wishlist

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.PURCHASEWISH, purchase"100500");
    Search Request



    Removing a product from the wishlist

    Method Objective

    The method gives the system an understanding of the user's search queriesunderstanding the user has removed a product from the wishlist.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.SEARCH, new Params().put(Params.Parameter.SEARCH_QUERY, search_query));

    Request parameters

    NameTypeRequirementDescriptionsearch_querystringrequiredSearch query phrase.Example of use
    REMOVE_FROM_WISH, product_id);

    NameTypeRequirementDescription
    product_idstringrequiredThe ID of the product removed from the wishlist

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_WISH, "100500");


    Update the current wishlist

    Method Objective

    The method updates the whole wishlist on the system side.

    Syntax and parameters

    Code Block
    languagejavaapplescript
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.SEARCH,Params full_wish = new Params();
    full_wish
        .put(Params.Parameter.SEARCHFULL_QUERY, "to be or not to be"));

    Adding a product to the wishlist

    Method Objective

    The method gives the system an understanding the user has added a product to the wishlist.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    WISH, true)
        .put(new Params.Item(product_id))
        .put(new Params.Item(product_id));
    PersonaClick.track(Params.TrackEvent.WISH, productfull_idwish);


    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    NameTypeRequirement
    Descriptionproduct_idstringrequiredThe ID of the product added to the wishlist

    Example of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.WISH, "100500");

    Removing a product from the wishlist

    Method Objective

    The method gives the system an understanding the user has removed a product from the wishlist.

    Syntax and parameters

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_WISH, product_id);
    NameTypeRequirementDescriptionproduct_idstringrequiredThe ID of the product removed from the wishlist
    Description
    product_idstringrequiredThe ID of the product added to the wish

    Example of use

    Code Block
    languageapplescript
    themeFadeToGrey
    Params full_wish = new Params();
    full_wish
        .put(Params.Parameter.FULL_WISH, true)
        .put(new Params.Item("146"))
        .put(new Params.Item("100500"));
    PersonaClick.track(Params.TrackEvent.REMOVE_FROM_WISH, "100500"full_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
    languagejava
    themeFadeToGrey
    PersonaClick.track(custom_event_key, category, label, value);


    NameTypeRequirementDescription
    custom_event_keystringrequiredUnique custom event key. Must be pre-created in the PersonaClick account: Settings > Custom events.
    categorystringoptionallyA category is a name that you supply as a way to group some event's properties.
    labelstringoptionallyWith labels, you can provide additional information for events that you need.
    valuenumberoptionallyThe value property can be any integer and can be used to send a specific value in an event.

    Examples of use

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track("my_event");

    Code Block
    languagejava
    themeFadeToGrey
    PersonaClick.track("my_event", "my_category", "my_label", 100500);



    Column

    Page Navigation

    Table of Contents
    maxLevel2
    indent0px
    stylenone




    Related Pages

    Filter by label (Content by label)
    showLabelsfalse
    showSpacefalse
    sorttitle
    cqllabel = "tracking"