Product click events

    Product click events


    Article summary

    If you want to open the product page in the current window when a product is clicked in the player, you can define CLICK_PRODUCT event as follows.

    Sample code: Adding parameter to product URL

    <script type="text/javascript" src="https://static.shoplive.cloud/shoplive.js"></script>
    <script> 
    var messageCallback = {
          CLICK_PRODUCT: function (payload) {
            // CLICK_PRODUCT callback not supported when PIP config is enabled from admin
            // You can add a new parameter to the URL of the clicked product.
            var url = payload.url + "&parameter=" +"{your_parameter}";
    
            // The product page will be opened in the current window.
            location.href = url;
          },
        };
    cloud.shoplive.init({ accessKey: 'YOUR ACCESS KEY HERE', messageCallback: messageCallback });
    </script>


    What's Next