Integrate Rehearsals with AI IDEs (Lovable, v0, Replit, Cursor)
What is this?
This short guide shows you how to install the Rehearsals tracking script when you build or host your site inside an AI-powered IDE such as Lovable, v0, Replit, or Cursor. Once installed, Rehearsals will capture every visitor session and provide AI-generated insights to improve user experience.
Before You Start
- Make sure you’re on a paid tier (or any tier that lets you edit the project’s HTML/JS). Some free tiers restrict code-injection features.
- Create your Rehearsals account and copy your unique tracking snippet (it already contains your API Key and Organization ID).
- Have permission to edit your project in the chosen AI IDE.
Step 1: Copy Your Tracking Snippet
From your Rehearsals dashboard, copy the code that looks like this (your keys are pre-filled):
<script>
window.deepPredictionSettings = {
apiKey: 'dp_proj_xxxxx',
organizationId: 'dp_org_xxxxx'
};
</script>
<script async defer src="https://app.runrehearsals.com/recorder.js"></script>
Step 2: Let the AI IDE Add It Site-Wide
Instead of hunting for layout files, just paste one of the prompts below into your IDE’s chat/command box. Each prompt instructs the IDE to inject the snippet in every page—ideally just before </head> (or, if you prefer to lazy-load, right before </body>). No per-page work required.
// Prompt: I want to install an analytics product like Google Analytics that watches every page. This would traditionally be in the HTML header. Can you add it to my project so I can track every page?
// < Add your tracking snippet here >
Why use a prompt? All three tools let their built-in AI handle boilerplate edits, so you stay focused on building, not digging through repo folders.
Step 3: Verify It’s Working
- Run or deploy your project, then browse it in an incognito/private window for 30 seconds.
- Visit app.runrehearsals.com and log in. The dashboard will confirm that sessions are being captured.
- New replays should appear in the Rehearsals dashboard almost instantly.
Compliance Note
It’s your responsibility to provide visitors with a way to opt out of analytics if required by your local laws. Each IDE supports adding a consent banner or cookie notice—use one if needed.
What Happens Next
Now that Rehearsals is installed, you'll get access to powerful AI-driven features:
- Radar - Get instantly notified when users do positive or negative behaviors that impact revenue
- Rehearsals Brief - Receive McKinsey-level reports from 1,000+ data scientists analyzing your user sessions
- Customer Simulations - Rehearse revenue outcomes from pricing, product, and marketing changes in simulated environments
- Customer Data Extraction - Turn unstructured behavioral data into structured insights (names, interests, contact info)
- Visual Product Graph - Automatically map every button and screen to see exactly how customers navigate your site
Congrats! Rehearsals is watching every customer and will soon tell you why they turn, why they pay, and what you should build next.
This is the era of vibe analytics.