How to add Tack to a Lovable app: one prompt, then tests and surveys
Apps from Lovable, v0, Bolt or Replit are real code, so you add Tack the same way you would to any site: one script. You do not write it yourself. You paste a prompt into the chat, publish, and open the app once.
The Tack team··5 min read
Short answer
To add Tack to a Lovable app, add the app’s published address in Tack, copy the prompt the install wizard gives you and paste it into the Lovable chat. Lovable adds the script to index.html and saves a rule to keep it. Then publish and open the published app once: Tack confirms the install by itself.
With the script in place you can do two things. Before launch, send a Test to five people and see whether they manage a task. After launch, run a Pin: a short question that real visitors see on the page at the right moment.
On this page
Step 1: add the right address in Tack
In Tack, open Sites and install and add the address of the app. Only the domain counts, and each domain is its own site. A Lovable project can have three:
- The preview in the editor. It always shows your latest working version and has its own address, but opened in a new tab it asks for a Lovable login with access to the project (Lovable: Preview). Not the address to give testers.
- The published app at
your-app.lovable.app. Publishing there is free on all plans (Lovable: Publish). This is usually the one to add. - A custom domain, on paid plans. Once it is the primary domain, the lovable.app address redirects to it (Lovable: Custom domain).
Tests and Pins only run on the address the site is set to. If the script reports from somewhere else, for example after you connect a custom domain, Tack shows that address next to the site and offers Use this address. The site moves there and its Tests and Pins stay with it.
Step 2: paste the prompt into Lovable
Choose Lovable as the platform in the wizard and copy the prompt. With your own key and address it reads:
Add the Tack measuring script, which we use for usability tests, to this project. It must be on every page.
Plain site or React/Vite: put this tag in index.html (or the main template) right before </body>:
<script src="https://trytack.io/r/v1.js" data-site="pk_…" async></script>
Next.js: put it in the root layout (app/layout.tsx, or pages/_app.tsx) with next/script:
import Script from 'next/script';
<Script src="https://trytack.io/r/v1.js" data-site="pk_…" strategy="afterInteractive" />
Rules:
- Copy the tag exactly. Do not change the URL or data-site, do not turn it into an import and do not minify it.
- Add it only once.
- Keep it in every later change to the project. Also add this rule to the project Instructions (Project settings → Instructions).
Then deploy the site and open https://your-app.lovable.app once. Tack confirms the install by itself.The prompt covers both a plain React/Vite app, which is what Lovable creates, and Next.js, because you often do not know which one the tool chose. The last rule matters most: AI tools rewrite files freely, and a rule in the project’s standing instructions keeps the script from disappearing in a later change. In Lovable that place is Project settings → Instructions (Lovable: Instructions).
In v0, Bolt, Replit, Cursor or Claude Code it works the same way. The wizard only changes where the tool should keep the rule, such as replit.md or CLAUDE.md.
Step 3: publish and open the app once
The live app keeps showing the version you published until you publish again. Click Publish, then Publish changes (Lovable: Publish). Then open the published address once. Tack sees the script load and marks the site as installed.
Leave the app Public. With Invite only or Workspace access, visitors have to log in to Lovable first (Lovable: Website access), so testers cannot open it and Tack cannot check the page. If the site stays unverified, click Check the install: it tells you whether the script is missing, has another key, or sits behind a login.
Optional: tell Tack when a task succeeds
Tack can tell that a task worked by the page address or a click on an element. For things an address does not show, such as a sign-up that finished without errors, the app can send an event. Add one more line to the prompt, or send it as a follow-up:
After a successful sign-up, call window.tack?.track('signup_done'). Put no personal data in the event name.A Test can then count the task as done on signup_done, and a Pin can ask right after it, for example how easy the sign-up was.
Before launch: a Test with five people
Write one to three tasks with a clear end, such as “Create an account and add your first project”, and send the Test link to five people from your audience. They do it on their own, in their own browser. You see how many made it, how long it took, how hard it felt and where they clicked. The whole process is in How to test a prototype built with AI.
After launch: a Pin for real users
Once people use the app, a Pin asks them one to five questions on the page: after the signup_done event with the Task ease template, on the pricing page when they are about to leave. Each visitor sees at most one question per visit across all Pins.
Tack uses no cookies. Without consent a Pin still shows, but keeps no visitor ID across visits. If your app has a cookie banner, call window.tack.consent() when people accept, and Tack keeps an anonymous ID and visit count. Whether you need consent is your call as the site owner.
FAQ
How do I add a script to a Lovable app?
Ask Lovable in the chat to add the script tag to index.html right before the closing body tag, and to keep it in every later change. Then publish. Tack’s install wizard gives you a ready prompt that does exactly this.
Should I use the preview or the lovable.app address?
Use the published address. The preview needs a Lovable login with access to the project, so testers cannot open it. If you later connect a custom domain, Tack offers to move the site to the new address.
Does Tack work with v0, Bolt and Replit too?
Yes. The prompt is the same; only the place where the tool keeps the rule differs. Paste it into the tool’s chat, deploy, and open the deployed app once.
Why does Tack say the install is not verified?
Usually the change is not published yet, the app is not public, or the site in Tack has another address than the one you opened. Check the install in Tack tells you which.