Ce contenu n’est pas encore disponible dans votre langue.
Post-Purchase
Section titled “Post-Purchase”Summary
Section titled “Summary”The <frak-post-purchase> component is designed for checkout confirmation pages. It displays a sharing prompt to buyers, encouraging them to share the product with friends. The component adapts its message based on whether the user is a referrer (existing advocate) or a referee (was referred by someone).
Requirements
Section titled “Requirements”- An initialized
FrakSetupconfiguration object - Purchase tracking data (customer ID, order ID, and token) for attribution
More information about the FrakSetup object.
Parameters
Section titled “Parameters”| Attribute | Type | Description |
|---|---|---|
customerId | string | Merchant customer ID for purchase tracking. All three tracking props (customerId, orderId, token) must be present for tracking to fire. |
orderId | string | Merchant order ID for purchase tracking. |
token | string | Checkout token for purchase tracking. |
sharingUrl | string | Base URL to share. Falls back to the merchant domain when omitted. |
merchantId | string | Override the merchant ID resolved from SDK config. |
placement | string | Placement ID for backend-driven configuration. |
classname | string | CSS class names applied to the root element. |
variant | "referrer" | "referee" | Force a display variant instead of relying on backend evaluation. |
badgeText | string | Label for the badge pill above the message. Hidden when omitted. |
referrerText | string | Override the message shown to referrers. Use {REWARD} as placeholder. |
refereeText | string | Override the message shown to referees. Use {REWARD} as placeholder. |
ctaText | string | Override the CTA button text. Use {REWARD} as placeholder. |
imageUrl | string | Override the image shown on the left of the card. Falls back to the built-in gift icon when omitted. |
products | string | JSON-stringified array of product cards forwarded to the sharing page when the CTA is clicked (set the JS products property for a real array). |
preview | string | Render in preview mode (e.g. Shopify/WordPress theme editor): bypasses the client-ready gate and no-ops the click handler. |
previewVariant | "referrer" | "referee" | Which variant to show when preview is set. Defaults to "referrer". |
Usage Examples
Section titled “Usage Examples”Basic Post-Purchase
Section titled “Basic Post-Purchase”<frak-post-purchase customerId="cust_123" orderId="order_456" token="tok_abc"></frak-post-purchase>With Custom Text
Section titled “With Custom Text”<frak-post-purchase customerId="cust_123" orderId="order_456" token="tok_abc" badgeText="Thank you!" referrerText="Share with friends and earn {REWARD}!" refereeText="You were referred! Share to earn {REWARD} too." ctaText="Share now"></frak-post-purchase>With Placement
Section titled “With Placement”<frak-post-purchase placement="checkout" customerId="cust_123" orderId="order_456" token="tok_abc"></frak-post-purchase>Text and styling are resolved from the placement configuration set in the business dashboard.
With Custom Sharing URL
Section titled “With Custom Sharing URL”<frak-post-purchase customerId="cust_123" orderId="order_456" token="tok_abc" sharingUrl="https://my-shop.com/products/awesome-product"></frak-post-purchase>Force a Variant
Section titled “Force a Variant”<!-- Always show the referrer message --><frak-post-purchase variant="referrer" customerId="cust_123" orderId="order_456" token="tok_abc"></frak-post-purchase>Purchase Tracking
Section titled “Purchase Tracking”The component supports automatic purchase tracking when all three tracking attributes are provided:
customerId— Your internal customer identifierorderId— The order/transaction identifiertoken— A checkout token for verification
Target the component using the frak-post-purchase selector:
frak-post-purchase .override { background-color: #f0fdf4; border-radius: 12px; padding: 24px;}Component-specific CSS can also be configured via placements in the business dashboard.