Skip to content

Commit 6f0a271

Browse files
committed
chore(analytics): add beacon plugin (experimental)
1 parent c17f871 commit 6f0a271

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

_demo/plugins/cloudflare-beacon.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default defineNuxtPlugin(() => {
2+
const cloudflareScript = document.createElement('script')
3+
cloudflareScript.setAttribute('src', 'https://static.cloudflareinsights.com/beacon.min.js')
4+
cloudflareScript.setAttribute('defer', true)
5+
cloudflareScript.setAttribute('data-cf-beacon', '{"token": "cd0e6688bd0944719fe963c41759b992"}')
6+
document.body.appendChild(cloudflareScript)
7+
})

0 commit comments

Comments
 (0)