Skip to content

Commit

Permalink
chore(analytics): add beacon plugin (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed Feb 14, 2024
1 parent c17f871 commit 6f0a271
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _demo/plugins/cloudflare-beacon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default defineNuxtPlugin(() => {
const cloudflareScript = document.createElement('script')
cloudflareScript.setAttribute('src', 'https://static.cloudflareinsights.com/beacon.min.js')
cloudflareScript.setAttribute('defer', true)
cloudflareScript.setAttribute('data-cf-beacon', '{"token": "cd0e6688bd0944719fe963c41759b992"}')
document.body.appendChild(cloudflareScript)
})

0 comments on commit 6f0a271

Please sign in to comment.