Skip to content

Commit a3544bf

Browse files
yosriadyclaude
andcommitted
docs: clean up referral docs
Remove e.g. examples from referral params in what-we-collect, and rewrite the Web SDK referrals example to use the FormoAnalyticsProvider options format matching the Wagmi integration example. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4370b1b commit a3544bf

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

data/what-we-collect.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ They are added to a URL to track where a visitor came from.
180180

181181
We track these UTM codes and assign it to each user:
182182

183-
- `referral` (e.g.: google.com)
184-
- `ref` (e.g.: search)
183+
- `referral`
184+
- `ref`
185185
- `refcode`
186186

187187
### Wallet Provider

sdks/web.mdx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -679,13 +679,16 @@ const analytics = await FormoAnalytics.init('YOUR_API_KEY', {
679679

680680
Formo autodetects `ref`, `referral`, and `refcode` query parameters in the URL. You can customize how referrals are detected by the SDK:
681681

682-
```javascript
683-
const analytics = await FormoAnalytics.init('YOUR_API_KEY', {
684-
referral: {
685-
queryParams: ['via', 'ref'],
686-
pathPattern: '/referral/([^/]+)'
687-
}
688-
});
682+
```tsx
683+
<FormoAnalyticsProvider
684+
writeKey="<YOUR_WRITE_KEY>"
685+
options={{
686+
referral: {
687+
queryParams: ['via', 'ref'], // Query params to detect (default: ['ref', 'referral', 'refcode'])
688+
pathPattern: '/referral/([^/]+)', // Regex to extract referral code from the URL path
689+
},
690+
}}
691+
>
689692
```
690693

691694
In the above configuration, Formo will detect referrals from:

0 commit comments

Comments
 (0)