Skip to content

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 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 and event-name:

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 Description
before_crawl Triggered before we look for product information on your 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.