← All integration guides

HTML

Add Analytica to any static site with one script tag.

Install the tracker

Copy the tracker script into your page template before the closing body tag. Replace the project ID with the tracking ID shown in your dashboard.

<script async src="https://analytics.example.com/analytica.js"></script>
<script>
  window.analytica = window.analytica || [];
  window.analytica.push(["init", { projectId: "prj_your_site" }]);
</script>

Track custom events

Use the tracker queue for product events without adding cookies or personally identifying data.

Name events carefully — dashboard Goals with match type “event” count track events whose name equals the goal value (for example signup_completed).

window.analytica.push(["track", "signup_completed", {
  plan: "starter"
}]);

Path goals and funnels

Pageviews are enough for path-based goals and funnel steps. Create a goal or funnel step with match type “path” and value like /pricing or /checkout/success.