Tutorial

Optional Functions

The functions listed in this section are optional, and are not required for Granify to run.

Tracking Wish List

This function is used to notify Granify what the current customer's wish lists contain. This method can be called multiple times for different lists you wish to track. Please ensure that you use a unique list_name for each.

Placement

This method should be called immediately after the page loads, and after the Granify.setShopperId call (see: Setting Shopper ID).

Usage

For usage information, see the Granify.trackWishList documentation.

Example

Granify('trackWishList', {
  list_name: 'wishList',
  items: [
    {
      in_stock: true,
      product_id: '1234',
      sku: '123456',
      price: 150.00,
      regular_price: 200.00,
      title: 'Mask',
      image: 'https://example.com/image.jpg',
      date_added: 1584274822,
      price_when_added: 175.00,
      cta_url: 'https://example.com/123456',
      product_url: 'https://example.com/123456',
    }
  ]
});

Tracking User Data

This function is used to store any information you want to remember and persist for any user of the device on which it is running. It will persist across pages and multiple sessions.

Placement

This method should be called immediately after the page loads, and after the Granify.setShopperId call (see: Setting Shopper ID).

Usage

For usage information, see the Granify.trackUserData documentation.

Example

Granify('trackUserData', {
  member_id: '123456',
  rewards_promotion_available: ['reward1', 'reward2'],
  credit_card: true,
  gender: 'm',
  birthday: '12/01'
});