Skip to content

Commit 031bded

Browse files
committed
Update conversion-tracking.html
1 parent 336f06f commit 031bded

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

apps/html/conversion-tracking.html

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@
2424
</script>
2525

2626
<script>
27-
// Add a 3-second delay before loading the script to test queue functionality
28-
setTimeout(() => {
29-
const script = document.createElement('script');
30-
script.defer = true;
31-
script.src = './analytics/script.conversion-tracking.js';
32-
script.setAttribute('data-api-host', 'http://api.localhost:8888');
33-
script.setAttribute(
34-
'data-publishable-key',
35-
'dub_pk_BgyBCEJCPCGN3RN7oieLVHRs',
36-
);
37-
document.head.appendChild(script);
38-
}, 3000);
27+
const script = document.createElement('script');
28+
script.defer = true;
29+
script.src = 'https://dubcdn.com/analytics/script.conversion-tracking.js';
30+
script.setAttribute(
31+
'data-publishable-key',
32+
'dub_pk_xxxxxxxx', // get your publishable key from https://app.dub.co/settings/analytics
33+
);
34+
document.head.appendChild(script);
3935
</script>
4036

4137
<header>

apps/nextjs/app/layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export default function RootLayout({
3030
scriptProps={{
3131
src: DUB_ANALYTICS_SCRIPT_URL,
3232
}}
33+
// optional – only needed for client-side conversion tracking
34+
// get your publishable key from https://app.dub.co/settings/analytics
35+
publishableKey="dub_pk_xxxxxxxx"
3336
/>
3437
</html>
3538
);

0 commit comments

Comments
 (0)