The Frisbii Media JavaScript SDK communicates with the parent page exclusively via browser events. All events are dispatched on document and can be listened to with document.addEventListener.
This page is a complete reference of all events across checkout, SSO, Snippets, and analytics. For usage examples see the individual feature articles.
Checkout events
plenigo.PurchaseSuccess
Fired when the checkout flow ends — either after a successful payment, when the customer already owns the product, or when no purchase was possible due to rules.
Always check orderId to determine the actual outcome.
document.addEventListener("plenigo.PurchaseSuccess", function(e) {
if (e.type !== "plenigo.PurchaseSuccess") return false;
var orderId = parseInt(e.detail.orderId);
if (orderId > 0) {
location.href = "/success/?order=" + orderId;
} else {
location.href ="/already-subscribed/";
}
});
| Type | Description |
|---|---|---|
| integer |
|
| string | Present when using Frisbii Media SSO checkout ( |
| object | Any extra properties passed to the |
plenigo.PurchaseFailed
Fired when a payment provider communication error causes the checkout to fail and recovery is not possible. Recommendation: restart the checkout (e.g. reload the page).
document.addEventListener("plenigo.PurchaseFailed", function(e) {
if (e.type !== "plenigo.PurchaseFailed") return false;
console.error("Checkout failed:", e.detail);
location.href = "/checkout-failed/";
});
| Type | Description |
|---|---|---|
(varies) | Error details from the payment provider. Log for debugging. |
plenigo.Error
Fired for unrecoverable errors that the customer cannot resolve without reloading the page.
document.addEventListener("plenigo.Error", function(e) {
if (e.type !== "plenigo.Error") return false;
console.error("Error:", e.detail.errorMsg);
location.reload(true);
});
| Type | Description |
|---|---|---|
| string | Human-readable error message. |
SSO events
plenigo.LoginSuccess
Fired when a login, registration, or password reset flow completes successfully. The customerSession must be passed to your backend to create a server-side session.
document.addEventListener("plenigo.LoginSuccess", function(e) {
if (e.type !== "plenigo.LoginSuccess") return false;
location.href = "/start-session/?session=" + e.detail.customerSession;
});
| Type | Description |
|---|---|---|
| string | Short-lived session token. Pass to your backend immediately. Use it to create a server-side session via |
This event is also fired by
plenigo.Checkout(...).login()and.register(). In those casese.detailadditionally containsorderIdand the checkout result fields.
Web analytics events
plenigo.WebAnalyticsLoad
Fired every time a new page loads inside the checkout or SSO iframe. Use this to forward virtual page views to your analytics tool.
document.addEventListener("plenigo.WebAnalyticsLoad", function(e) {
console.info("Page loaded inside iframe:", e.detail);
// Forward to analytics, e.g. gtag('event', 'page_view', { page_title: e.detail.page })
});
| Type | Description |
|---|---|---|
| string | The page name that loaded inside the iframe. See the page name reference table in Web Analytics Integration. |
Summary table
Event | Triggered by | Key |
|---|---|---|
| Checkout completion (all outcomes) |
|
| Payment provider error | Error details |
| Unrecoverable checkout error |
|
| SSO login / register / forgot password |
|
| Any page load inside checkout or SSO iframe |
|
* Present only in specific scenarios (see individual event descriptions above)
Listening pattern
All events follow the same listening pattern. Always check e.type at the start of your handler to avoid double-firing when multiple listeners are registered:
document.addEventListener("plenigo.PurchaseSuccess", function(e) {
if (e.type !== "plenigo.PurchaseSuccess") return false;
// ... your logic
});