Custom and purchase events
Track business milestones, declarative clicks, orders, and revenue from the browser.
Call PageDuel.track("Signup") after the action succeeds. Pass an optional properties object for stable, non-sensitive context. For declarative click goals, add data-pd-goal="Demo requested" to the clickable element.
Record a browser-side purchase with PageDuel.trackPurchase(amount, properties), or include revenue on a custom event. Amounts use the site's reporting currency. PageDuel.getVisitorId() returns the attribution ID you can pass to your server or payment checkout.
Completion events should fire after success, not on button click. Never send passwords, card data, secrets, or unnecessary personal information. Do not duplicate an order through browser, server, and provider webhook tracking.