</body> tag and the widget button appears automatically. This page shows you exactly where to find the snippet, what each attribute does, and how to place it correctly in common frameworks.
Find the snippet in your Dashboard
Every project has its own ready-to-copy snippet. To find it:- Open your project from the Projects list.
- Go to Settings → Widget.
- Click Copy Snippet — the full script tag is copied to your clipboard with your real project token already filled in.
The widget script tag
The snippet you copy from the Dashboard looks like this:YOUR_PROJECT_TOKEN with the token shown in your project’s Settings → Widget screen (or just copy the pre-filled snippet — it’s already correct).
Script tag attributes
| Attribute | Required | Description |
|---|---|---|
src | Yes | The URL of the NOCK widget script. Do not change this value. |
data-token | Yes | Your unique project token. This tells NOCK which project inbox to send feedback to. |
data-api-base | No | The NOCK API endpoint. Defaults to https://nocknock.cloud — leave this value unchanged. |
Additional configuration options — such as button position, colour, and which data-capture features to enable — are managed from the Dashboard under Settings → Widget. You don’t need extra attributes in the script tag to use them.
Placing the snippet
Open your site's global layout or HTML template
The snippet must load on every page where you want the widget to appear. In most setups this means your global layout file, your base HTML template, or a shared footer component.
Paste the snippet before the closing body tag
Place the script tag as the last element inside
<body>, immediately before </body>. Loading it here ensures your page content renders first and the widget doesn’t block any other scripts.Framework tips
NOCK works with any framework that renders HTML. Here are the most common placement patterns:| Framework / Setup | Where to add the snippet |
|---|---|
| Plain HTML | Inside the <body> of every HTML file, or a shared footer.html partial |
| React (Create React App / Vite) | public/index.html, before </body> |
| Next.js | app/layout.tsx (App Router) or pages/_document.tsx (Pages Router), inside the <body> |
| Nuxt.js | app.vue or a layout file, using a <script> tag via useHead or directly in the template |
| Astro | A global layout component, inside the <body> slot |
| WordPress | Theme’s footer.php, before </body> — or use a header/footer plugin |
| Webflow | Project Settings → Custom Code → Footer Code |
| Shopify | theme.liquid, before </body> |
What’s next?
Your widget is installed. Now open your live site and confirm the button appears and feedback flows through correctly.Test Your Widget
Send a test ticket and verify everything is working end to end.