Skip to main content

Capturing Partoo App Events with Callbacks

You can configure callbacks to be triggered when specific events occur in the embedded Partoo App. These callbacks allow your integration to respond to user actions such as creating a business, clicking links, or encountering errors.
Some callbacks are blocking (they prevent the default behavior unless explicitly continued), while others are non-blocking (the Partoo App continues its normal flow).

Setting Up a Callback

Use the .on(eventId, callback) method from the Partoo page instance to register an event listener.

Syntax

partooPage.on(eventId, callbackFunction);
  • eventId — a string identifier for the event
  • callbackFunction — a JavaScript function that receives an event-specific data object

Example

const subscribeCallback = (data) => {
  console.log('User subscribed to:', data);
};

partooPage.on('subscribe', subscribeCallback);

Supported Callback Events

subscribe

Triggered when a user clicks Subscribe.
{
  "productName": "presence_management",
  "businesses": [
    {
      "id": "5a2ab4edb12ff67cba1b7e1b",
      "org_id": 709,
      "name": "SCEP du Caire"
    }
  ]
}

open_business

Triggered when a user opens a business page.
// data = "5a2ab4edb12ff67cba1b7e1b"

business_created

Triggered after a business is created and saved.
This callback does not block redirection to the business edit page.
// data = "5a2ab4edb12ff67cba1b7e1b"

business_additional_info_updated

Triggered when additional info is updated and saved.
This is a non-blocking callback.
// data = { ... }

business_address_updated

Triggered when address information is updated and saved.
This is a non-blocking callback.
// data = { ... }

business_contact_updated

Triggered when contact details are updated.
This is a non-blocking callback.
// data = { ... }

business_description_updated

Triggered when a business description is updated.
This is a non-blocking callback.
// data = { ... }

business_open_hours_updated

Triggered when open hours are updated and saved.
This is a non-blocking callback.
// data = { ... }

error

Triggered when a rendering error occurs (e.g. HTTP 400, 403, 404, 500).
// data = 403  // HTTP status code

no_business_click

Triggered when the No Business button is clicked.
partooPage.on('no_business_click', () => {
  // Handle click event
});

no_eligible_business_click

Triggered when the No Eligible Business button is clicked.
partooPage.on('no_eligible_business_click', () => {
  // Handle click event
});

pm_view_go_to_edit_click

Triggered when a user clicks Edit in the Presence Management view.
partooPage.on('pm_view_go_to_edit_click', () => {
  // Handle redirection to business edit
});

pm_view_go_to_partner_connection_click

Triggered when a user clicks a link to go to Partner Connection from Presence Management.
partooPage.on('pm_view_go_to_partner_connection_click', () => {
  // Handle redirection to connection view
});

Use callback data to sync user actions with your backend, trigger alerts, or log analytics events in real-time.