Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Subscribe to the "Back in Stock" trigger

Method Objective

The method subscribes the user to an email notification the notifications that the product is available.

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("subscribe_trigger", "product_available", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
itemnumber/stringrequiredThe product ID to notify of the product availability the user will be subscribed.
emailstringrequiredoptionallyThe current user's Email. If not set, the subscription will be on Web Push notification.
webpushbooleanoptionallyThis property, if true, additionally adds the Web Push notification subscription for the specified product.
propertiesObjectoptionally

Additional product properties. The following are available:

  • fashion_size (number/string) - clothing size. The value of the parameter in the internal format of the store.
Example

Examples of use

Code Block
languagejs
themeFadeToGrey
// subscribing to both channels: Email and Web Push Notifications
personaclick("subscribe_trigger", "product_available", {
    item: "100500", 
    email: "john.doe@examplestore.com",
    webpush: true
    properties: {
        fashion_size: "XL"
    }
});

Code Block
languagejs
themeFadeToGrey
// subscribing to Email Notification only
personaclick("subscribe_trigger", "product_available", {
    item: "100500", 
    email: "john.doe@examplestore.com"
});

Code Block
languagejs
themeFadeToGrey
// subscribing to Web Push Notification only
personaclick("subscribe_trigger", "product_available", {
    item: "100500"
});



Unsubscribe from the "Back in Stock" trigger

Method Objective

The method unsubscribes the user from an email the notification that the product is available.

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("unsubscribe_trigger", "product_available", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
item_idsarrayrequiredAn array of product IDs for which the user would like to unsubscribe from the product availability notification. You can use an empty array to unsubscribe from all products.
emailstringrequiredThe current user's Email.

Examples of use

Code Block
languagejs
themeFadeToGrey
personaclick("unsubscribe_trigger", "product_available", {
    item_ids: ["100500", "146", "12"], 
    email: "john.doe@examplestore.com"
});

Code Block
languagejs
themeFadeToGrey
personaclick("unsubscribe_trigger", "product_available", {
    item_ids: [], // unsubscribe from all products
    email: "john.doe@examplestore.com"
});


Subscribe to the "Price Drop" trigger

Method Objective

The method subscribes the user to an email notification the notifications of a product price decrease.

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("subscribe_trigger", "product_price_decrease", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
itemnumber/stringrequiredThe product ID to notify of the product price drop the user will be subscribed.
pricenumberrequiredThe current product price.
emailstringrequiredoptionallyThe current user's Email. If not set, the subscription will be on Web Push notification.
webpushbooleanoptionallyThis property, if true, additionally adds the Web Push notification subscription for the specified product.
propertiesObjectoptionally

Additional product properties. The following are available:

  • fashion_size (number/string) - clothing size. The value of the parameter in the internal format of the store.
Example

Examples of use

Code Block
languagejs
themeFadeToGrey
// subscribing to both channels: Email and Web Push Notifications
personaclick("subscribe_trigger", "product_price_decrease", {
    item: "100500", 
    price: 146.55, 
    email: "john.doe@examplestore.com",
    webpush: true,
    properties: {
        fashion_size: "XL"
    }
});

Code Block
languagejs
themeFadeToGrey
// subscribing to Email Notification only
personaclick("subscribe_trigger", "product_price_decrease", {
    item: "100500", 
    price: 146.55, 
    email: "john.doe@examplestore.com"
});

Code Block
languagejs
themeFadeToGrey
// subscribing to Web Push Notification only
personaclick("subscribe_trigger", "product_price_decrease", {
    item: "100500", 
    price: 146.55 
});


Unsubscribe from the "Price Drop" trigger

Method Objective

The method unsubscribes the user from an email notification of a product price decrease.

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("unsubscribe_trigger", "product_price_decrease", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
item_idsarrayrequiredAn array of product IDs for which the user would like to unsubscribe from the price drop notification. You can use an empty array to unsubscribe from all products.
emailstringrequiredThe current user's Email.

Examples of use

Code Block
languagejs
themeFadeToGrey
personaclick("unsubscribe_trigger", "product_price_decrease", {
    item_ids: ["100500", "146", "12"], 
    email: "john.doe@examplestore.com"
});

Code Block
languagejs
themeFadeToGrey
personaclick("unsubscribe_trigger", "product_price_decrease", {
    item_ids: [], // unsubscribe from all products
    email: "john.doe@examplestore.com"
});


Table of Contents
maxLevel2
classpersonaclick-fixed-position