Quickstart
Install the SDK, add your domain, and confirm your first pageview in the console.
1. Create a project
Sign in to the console with Google and create an organization and project. Copy your public key — it starts with pk_live_.
2. Add allowed domains
In project settings, add every hostname where the script will run (for example example.com or www.example.com). This step is optional but recommended — if you leave it blank, your project accepts events from any origin until you add domains.
For local development, add localhost and include the data-allow-localhost attribute on the script tag (see below).
3. Install the script
Add this snippet to the <head> of your pages. Replace the public key with yours from the console.
<script
defer
src="https://cdn.rendercontext.com/analytics.js"
data-project="pk_live_YOUR_KEY"
></script>For local testing, add data-allow-localhost to the script tag. The console-generated snippet omits this attribute.
<script
defer
src="https://cdn.rendercontext.com/analytics.js"
data-project="pk_live_YOUR_KEY"
data-allow-localhost
></script>4. Confirm your first pageview
Deploy or open your site on an allowed domain. Pageviews are recorded automatically after the SDK fetches a render context from the edge. Open the project overview in the console — you should see your first event within a few seconds.
Page reports group dynamic URL segments automatically (for example /users/abc-123 appears as /users/:id). You can tune this in project settings under Path ID detection.
If nothing appears, check that the domain matches your allowed-domain list exactly and that the public key is correct. Events are not sent until render context succeeds.
5. Track custom events
Use analytics.track for actions beyond pageviews.
analytics.track("signup_completed");Events are batched and sent automatically. Call await analytics.flush() to send immediately.
Next steps
- Feature flags — roll out features to a percentage of visitors.
- Experiments — run A/B tests with conversion goals.