Skip to content

Commit

Permalink
ref → via
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Oct 2, 2024
1 parent 9dd1a02 commit 324dff9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/script/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
apiKey: ak,
attributionModel: am || 'last-click',
cookieOptions: co ? JSON.parse(co) : null,
queryParam: qp || 'ref',
queryParam: qp || 'via',
};
}

Expand Down Expand Up @@ -126,7 +126,7 @@
return;
}

// When the identifier is present in the URL, track the click and set the cookie (?ref=...)
// When the identifier is present in the URL, track the click and set the cookie
const identifier = searchParams.get(queryParam);

if (!identifier) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import { Analytics as DubAnalytics } from "@dub/analytics"

### `queryParam`

The query parameter to listen to for client-side click-tracking (e.g. `?ref=abc123`). The default is `ref`.
The query parameter to listen to for client-side click-tracking (e.g. `?via=john`, `?ref=jane`). The default is `via`.

### `scriptProps`

Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export interface AnalyticsProps {
};

/**
* The query parameter to listen to for client-side click-tracking (e.g. `?ref=abc123`)
* The query parameter to listen to for client-side click-tracking (e.g. `?via=john`, `?ref=jane`).
*
* @default 'ref'
* @default 'via'
*/
queryParam?: string;

Expand Down

0 comments on commit 324dff9

Please sign in to comment.