JavaScript API
The snippet exposes window.pingado once it has loaded, and fires a pingado:ready event on window.
window.addEventListener('pingado:ready', () => { console.log(window.pingado.vid())})| Function | What it does |
|---|---|
pingado.vid() |
The visitor ID, or null without analytics consent. Pass it to your server when you create checkouts. |
pingado.lead(email, { firstName, lastName }) |
Records a lead and sends it to your connected ad accounts from the browser pixels and from Pingado’s servers, with one event ID. The email and name are masked and hashed in the browser. Returns the lead’s event ID. |
pingado.identify(email, { firstName, lastName }) |
Tells Pingado who the visitor is without recording a lead, for example after sign-in. It always wins: it replaces an email Pingado already holds for the visitor, which forms, the dataLayer and URLs cannot. |
pingado.track(event, { value, currency, eventId }) |
Fires a funnel event from your code: 'lead', 'onboarding', 'trial', 'checkout' or 'purchase'. value and currency are optional. eventId is your own ID for the event, so it counts once however often you call it, for example once per checkout. Returns the event ID. |
pingado.confirmed() |
Whether Pingado already knows who this visitor is in this browser: they became a lead, signed up or logged in through a form, or your code called pingado.identify(). A store checkout uses it to send a lead for new shoppers only. |
pingado.confirm(provider, orderId) |
Confirms an order outside a confirmation URL. |
pingado.checkoutUrl(url) |
Returns a checkout URL with the visitor ID added, for checkout links built in JavaScript. |
pingado.linkUrl(url) |
Returns a link to your other domain with the visitor added. See Cross-domain tracking. |