Skip to content
pixelary Docs

Lovable

index.html

Lovable apps are React single-page apps. Add the script to index.html once; Pixelary tracks page views as visitors move between routes.

1 Add the script to index.html

Ask Lovable to make the change. Paste your own site key from the dashboard into this prompt:

Prompt for Lovable
Add Pixelary conversion tracking. In index.html, inside <head>, add exactly this, unchanged:

<script>
  window.pixelary = window.pixelary || function () {
    (window.pixelary.q = window.pixelary.q || []).push(arguments);
  };
</script>
<script async src="https://cdn.pixelary.app/s/px_7hq2lm4x.js"></script>

Don't add any other tracking code.

If you edit the code yourself, put the same lines into the <head> of index.html:

index.html
<script>
  window.pixelary = window.pixelary || function () {
    (window.pixelary.q = window.pixelary.q || []).push(arguments);
  };
</script>
<script async src="https://cdn.pixelary.app/s/px_7hq2lm4x.js"></script>

2 Publish and add your domain

Publish the app and add every domain it runs on to the site in the dashboard, including a custom domain. Events from other domains are ignored.

3 Send conversions from code

Sign-ups, checkouts and other app actions happen in your code, so send them with the JavaScript API:

TypeScript
// After a successful sign-up, for example
window.pixelary("track", "CompleteRegistration", {}, {
  user: { email: form.email },
});

For TypeScript, declare the global once:

TypeScript
// src/pixelary.d.ts
declare global {
  interface Window {
    pixelary: (command: string, ...args: unknown[]) => void;
  }
}
export {};
Pass customer data raw. Pixelary normalizes and hashes it in the browser for each platform.

Pixelary sends nothing a visitor has declined. In the EEA, the UK and Switzerland it waits for the visitor’s yes before any pixel loads or any event leaves the page.

Visitors from Europe need a consent banner

Without a banner, Pixelary never gets a yes from visitors in the EEA, the UK and Switzerland, so they are not tracked.

Pixelary reads these on its own, with no extra setup:

  • Google Consent Mode v2
  • IAB TCF 2.2
  • Global Privacy Control
  • Cookiebot
  • OneTrust
  • CookieYes
  • Usercentrics
  • Complianz
  • iubenda
  • Termly
  • Osano
  • CookieFirst
  • Didomi (via TCF)
  • Framer cookie banner

Another banner can pass its answer with one line of code. Consent & banners

Something here doesn’t match what you see? Write to hello@pixelary.app.