Whisk Docs
Whisk HomeHelp CenterDeveloper Tools
v1.0.0
v1.0.0
  • Overview
  • Guides
    • Creating An Account
    • Getting Started
    • Whisk Sandbox
  • API
    • Authentication
      • Server Token
      • Client Token
      • User Access Token
      • Anonymous Access
    • Recipes
      • Get Recipe
      • Get Recipe Categories
      • Recipe Objects
    • Recipe Discovery
      • Recipe Feed
      • Recipe Search
      • Get Similar Recipes
    • Shopping Lists
      • Get Shopping Lists
      • Create A Shopping List
      • Add Items To A Shopping List
      • List Analysis
    • Meal Plans
      • Meal Plan Management
      • Delete Meals
      • Auto-Generator
      • Error Handling
    • Retailers
      • Get Available Stores
      • Retailers Checkout Flow
      • Retailer Aliases
      • OAuth Retailer Flow
      • Retailer User Info
      • Search Store Items
    • Carts
      • Create a Cart
      • Update Cart Item
      • Splitting Combined Items
      • Add Items To Cart
      • Add Recipes To Cart
      • Get Cart Item Options
      • Swap Cart Item Product
      • Delete A Cart Or A Cart Item
      • Checkout
    • Users
      • Get A User
      • Update A User
    • User Recipes & Collections
      • Add User Recipe
      • Create A Recipe
      • Update External Recipe
      • Get All User Recipes
      • Update User Recipe
      • Remove Recipe from Favorites
      • Create Collection
      • Get All User Collections
      • Get Collection
      • Get Recipes from a Collection
      • Remove Collection
    • Tools
      • Autocomplete
  • Shopping List SDK
    • Overview
    • Examples
      • Shoppable Recipes
      • Shoppable Products
      • Shoppable Media
    • Basic Setup
      • Basic Setup
      • Methods
      • Event Listeners
      • Widget
      • Subscriptions
      • Global Configuration
      • UTM Parameters
      • Using With SPA
  • Shopping List Mobile API
    • Overview
    • Examples
    • Reference
  • Tips and Tricks
    • Object IDs
    • URL Lookup
    • Searching
    • Multiple IDs request
  • Resources
    • Nutrients
    • Recipe Labels
    • Health Score, Glycemic Index, Glycemic Load
    • Whisk User Data
    • Supported Retailers
    • Optimizing Image Load
Powered by GitBook
On this page
  • Add products to the shopping list
  • Add products to the basket
  • Multiple product buttons on one page
  • Analytics and event tracking
  • More configuration options

Was this helpful?

  1. Shopping List SDK
  2. Examples

Shoppable Products

PreviousShoppable RecipesNextShoppable Media

Last updated 5 years ago

Was this helpful?

This functionality allows you to add one or more items to a shopping list or basket. Unlike , where the content is taken from the recipe page automatically by our scrapers, shoppable products allow you to specify the content manually.

Note: Shoppable products can only be created using your own buttons (there are no pre-built widgets to use).

Add products to the shopping list

  • Add products to shopping list

  • Add the SDK script to your page ideally in the . This script contains the core functionality of the SDK. Note: this should only be added to your page once.

var whisk = whisk || {};
whisk.queue = whisk.queue || [];
  • Lastly, we will make the button perform an action on click. Using the same ID as in step 1, we create a clickListener so Whisk knows what action to perform when the button is clicked. To add products straight to a shopping list, we use the method addProductsToList. You can pass one or more products.

whisk.queue.push(function() {
    whisk.listeners.addClickListener(
        'whisk-add-products',
        'shoppingList.addProductsToList', {
            products: ['Coffee', 'Ice Cream', 'Lemon']
        }
    );
});

This code should be added after the button code from step 1.

Add products to the basket

It’s possible to bypass the shopping list and allow users to add products straight to the basket.

  • Firstly, we need to create an HTML button on your page. You can set up any type of HTML element to be a button, the most important thing is to give the element a unique ID. This ID is used in step 3. This should be added to your page exactly where you want the button to appear.

    Add products to basket

  • Add the SDK script to your page, ideally in the . This script contains the core functionality of the SDK. Note: this should only be added to your page once.

var whisk = whisk || {};
whisk.queue = whisk.queue || [];
  • Lastly, we will make the button perform an action on click. Using the same ID as in step 1, we create a click eventListener so Whisk knows what action to perform when the button is clicked. This time we’re using another method – addProductsToBasket.

This code should be added after the button code from step 1.

whisk.queue.push(function() {
    whisk.listeners.addClickListener(
        'whisk-shop-products',
        'shoppingList.addProductsToBasket', {
            products: ['Coffee', 'Ice Cream', 'Lemon']
        }
    );
});

Multiple product buttons on one page

You can have multiple product buttons on one page. First, you’ll need to add the Whisk SDK script to the of your page (as above when adding one button). Next, create the HTML buttons and add click listeners, it’s important that each button has a unique ID like this:

whisk.queue.push(function() {
    whisk.listeners.addClickListener(
        "whisk-buy-product-A",
        "shoppingList.addProductsToBasket", {
            products: ["Chocolate"]
        });
    whisk.listeners.addClickListener(
        "whisk-buy-product-B",
        "shoppingList.addProductsToBasket", {
            products: ["Banana"]
        });
    whisk.listeners.addClickListener(
        "whisk-buy-product-C",
        "shoppingList.addProductsToBasket", {
            products: ["Tea"]
        });
});

Buy Product A Buy Product B Buy Product C

Analytics and event tracking

The Whisk shopping list SDK tracks many events and data points. These analytics can help you measure performance, analyze traffic and learn more about how your customers are interacting with the shopping tools.

Most of the analytics are only available to paid customers, although the SDK does have a Subscription service that allows you to tie in your own analytics for some basic events.

Full dashboard

Whisk offers a full, interactive analytics dashboard showing site-wide performance of Whisk on your website. This contains all information about how users are interacting with the shopping tools, you can sort by date range or devices and even export data.

Subscriptions

Subscriptions allow you to call any function you want in response to an SDK event. This will allow you to send events to your own analytics package.

For example, you can send an event to Google Analytics every time the Whisk button was viewed:

whisk.events.subscribe('whisk-shop-products', 'view', function() {
    // your custom code, for example:
    ga('send', {
        hitType: 'event',
        eventCategory: 'Whisk widget',
        eventAction: 'view',
        eventLabel: 'Fall Campaign'
    });
});

More configuration options

There are many available parameters of the click handler functionality that let you customize various parts of the experience, from the default language to which retailers a user sees.

View the SDK Reference to see all parameters, their definitions, and possible values.

Firstly, we need to create an HTML button on your page. You can set up any type of HTML element to be a button, the most important thing is to give the element a unique ID. This ID is used in step 3. This should be added to your page exactly where you want the button to appear. You can to discuss full-service creation of buttons.

Important: When you add items to baskets, Whisk’s matching algorithm considers various factors (including available store items, quantity, brand, attributes, and price) to find appropriate products at all retailers. In some cases, matching to very specific store items (brands) will not happen out of the box. Please to discuss your specific needs.

Note: If you're planning to use our analytics on a page with multiple click listeners, please refer to the option trackView on the .

In all cases for analytics, you’ll need a trackingID so we can link all data to your account. Please for more information.

The exact list of events is defined by integration type. See events available for and .

Read the for more information.

contact us
contact us
click listeners page
contact us
click listeners
widgets
Subscriptions API
shoppable recipes
image alt text
image alt text