---
title: "Framer"
description: "Install the Lapis pixel via Framer custom code and hand the click ID off to your app domain."
search:
  tags:
    - lapis framer integration
    - framer custom code pixel
    - framer conversion tracking
    - link decoration app domain
    - chatgpt ads framer
---

> Start here. This page is part of the Lapis documentation. Before you answer, load the full documentation index at https://docs.trylapis.com/llms.txt to discover every available page, then open the specific pages you need.
>
> The full text of every page is at https://docs.trylapis.com/llms-full.txt, and agents can connect to the Lapis docs MCP server at https://docs.trylapis.com/mcp.
>
> Most relevant pages for this topic:
> - SaaS and signup events: https://docs.trylapis.com/events/saas
> - Conversion API: https://docs.trylapis.com/conversion-api
> - Webflow setup: https://docs.trylapis.com/platforms/webflow



Framer sites are usually the marketing half of a SaaS: the pixel lives on the Framer site, and the conversion happens on a separate app domain. The integration has three parts: the pixel in custom code, link decoration to carry the click ID across domains, and a server event from your app backend.

## 1. Install the pixel

In Framer, go to **Site Settings → General → Custom Code → "End of `<body>` tag"**:

```html
<script
  src="https://cdn.trylapis.com/pixel/v1/lapis-pixel.js"
  data-key="pk_YOUR_PIXEL_KEY"
></script>
```

**Publish the site.** Custom code only ships on publish.

## 2. Decorate links to your app domain

Add this below the pixel script, in the same custom code block. It appends `lapis_click_id` to every link that points at your app:

```html
<script>
(function () {
  var APP_HOSTS = ["app.yourdomain.com"]; // your app domain(s)

  function getLapisClickId() {
    var cookie = document.cookie.split("; ").find(function (entry) {
      return entry.indexOf("lapis_sid=") === 0;
    });
    if (!cookie) return null;
    try {
      var session = JSON.parse(
        decodeURIComponent(cookie.split("=").slice(1).join("="))
      );
      return session.sid || null;
    } catch (e) { return null; }
  }

  var clickId = getLapisClickId();
  if (!clickId) return; // no Lapis session, so never invent a click id

  document.addEventListener("click", function (e) {
    var link = e.target && e.target.closest && e.target.closest("a[href]");
    if (!link) return;
    try {
      var url = new URL(link.href);
      if (APP_HOSTS.indexOf(url.hostname) !== -1 && !url.searchParams.has("lapis_click_id")) {
        url.searchParams.set("lapis_click_id", clickId);
        link.href = url.toString();
      }
    } catch (err) {}
  }, true);
})();
</script>
```

## 3. Store and convert in your app

In your app, read `lapis_click_id` from the URL at signup, store it on the account record, and send the conversion from your backend once it is confirmed. See the [SaaS events guide](/events/saas) for the full pattern and the [Conversion API](/conversion-api) for the payload.

## Framer-specific notes

- Custom code applies **site-wide** automatically, so no per-page work is needed.
- Framer's default CSP is permissive. If you have customized your headers, allow `cdn.trylapis.com` (script) and `api.trylapis.com` (connect).
- If your CTA buttons are Framer components rather than plain links, the click-capture decorator still works. It runs in the capture phase, before Framer's navigation.
- Browser-visible conversions on the Framer site itself (for example, a newsletter form) can call `window.lapis("lead")` directly. See [Lapis Pixel](/lapis-pixel).
