SDK API Reference
The API Reference for our JavaScript SDK
window.postscript
When the SDK is installed properly, you should be able to reference it using window.postscript
.
window.postscript.identify
Identifies a subscriber on your site.
Usage:
window.postscript.identify({
phone: "555-555-5555"
});
Payload | Description |
---|---|
| A JSON payload object to use to identify the subscriber. It must have a |
Returns result indicating whether or not a subscriber was found and if so, that they were cookied.
window.postscript.event
Fires an event for a subscriber.
Usage:
window.postscript.event('event_name', payload);
Supported Events
Event Name | Payload | Description |
---|---|---|
|
| Fires an event for Subscriber Viewed Product. For use in "Subscriber Viewed Product" automations (i.e. Browse Abandonment). |
|
| Fires an event for Product Added to Cart. For use in "Product Added to Cart" automations (i.e. Browse Abandonment). |
window.postscript.getSubscriberId
Returns a Postscript Subscriber ID if found.
Usage:
window.postscript.getSubscriberId();
Updated about 2 months ago