Attribution
The Attribution component displays affiliate attribution information, showing which rep/affiliate the customer is associated with.
Usage
<fluid-attribution></fluid-attribution>
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
hide-widget | boolean | false | Whether to hide the component |
class-name | string | — | Additional CSS classes |
show-avatar | boolean | true | Show affiliate avatar |
show-name | boolean | true | Show affiliate name |
show-contact | boolean | false | Show contact information |
Display Options
| Attribute | Type | Default | Description |
|---|---|---|---|
layout | string | 'horizontal' | Layout: 'horizontal', 'vertical', 'compact' |
fallback-text | string | — | Text to show when no attribution exists |
Examples
Basic Attribution Display
<fluid-attribution></fluid-attribution>
Compact Layout
<fluid-attribution layout="compact" show-avatar="true" show-name="true" ></fluid-attribution>
With Contact Info
<fluid-attribution show-contact="true" layout="vertical" ></fluid-attribution>
With Fallback
<fluid-attribution fallback-text="Shop with our company" ></fluid-attribution>
JavaScript API
// Get current attribution data const attribution = window.FairShareSDK.getAttribution(); console.log('Affiliate ID:', attribution.affiliate_id); console.log('Affiliate Name:', attribution.name); console.log('Attribution Source:', attribution.source);
Related
- getAttribution — Get attribution data programmatically
- lookupAffiliate — Look up affiliate information