Event binding

To bind functions to events within the Hello Retail script, you can include the following JavaScript snippet anywhere on your site. It can be used at any time, before and after the script is loaded.

_awev=(window._awev||[]);_awev.push(["{action}", "{event-name}", callback]);

There are the following options for action:

Action

Description

bind

The callback will be called each time the event ‘name’ occurs. If ‘name’ has already occurred, the callback will be called once immediately (no matter how many times ‘name’ previously occurred).

bind_once

The callback will be called once, when ‘name’ first occurs. If ‘name’ has already occurred, the callback will be called immediately, and never again.

unbind

If you no longer want to receive callbacks for an event, you can unbind it, by specifying the same name and callback as you used when binding. Note, that it must be the same instance of the function that was bound.

Event-name have the following options:

Event

Description

before_crawl

Triggered before we look for product information on you site.

context_ready

Triggered when we have collected the URL of the current page, and found product information using cached selectors

crawl_completed

Triggered when we have finished looking for product information. (It will be triggered regardless of whether we actually found any info or not)

user_avail

Triggered when the script has retrieved user information from our backend.

panel_build

Triggered when the wish list panel is ready to be displayed. (This won’t be triggered if you have disabled the wish list panel)

For most