> For the complete documentation index, see [llms.txt](https://help.gleantap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.gleantap.com/forms/customizing-design.md).

# Customizing Design

Once your form is saved, you can customize how it looks and add advanced behavior — including your own analytics, custom CSS for embed sizing, or JavaScript that pre-fills known visitors.

To open the customization editor:

1. Go to **Forms & Pages → Forms**.
2. Click the **three dots** (⋮) or **gear icon** on the right of any form in the list.
3. Click **Customize Design**.

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2Fl82MjJhzPPPeM7HtvOcY%2FScreenshot%202023-09-27%20at%203.03.40%20PM.png?alt=media&#x26;token=17f015c6-79ff-4cec-9799-be5e11fa956d" alt="" width="363"><figcaption></figcaption></figure>

The editor has three sections: **Form Design**, **CSS**, and **Tracking Codes**.

***

## Form Design

Visual customization. Add a background image, change the background/form/border/text colors, or add a logo.

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FgiGZYXeyV32b0cUWrZ5M%2FScreenshot%202023-09-27%20at%203.06.41%20PM.png?alt=media&#x26;token=8227df63-f1b9-4b58-98a3-7200f2c9bb0a" alt=""><figcaption></figcaption></figure>

For anything the visual editor doesn't cover, use the CSS section below.

***

## CSS

Paste any custom CSS to further style your form. Common uses:

* **Resize an embedded form or popup** — target the form container to control width, height, padding, and margins.
* **Match your site's typography** — override the default font family, weight, and sizes.
* **Style a specific field** — target individual field wrappers by class.

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FT7bs7A7XkCtrKvKDCvoA%2FScreenshot%202023-09-27%20at%203.11.13%20PM.png?alt=media&#x26;token=3753abdc-17b0-4a1a-8cd6-9c502f4890a0" alt=""><figcaption></figcaption></figure>

**Example: resize a form embedded on your homepage**

```css
.gleantap-form-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px;
}
```

**Example: override font**

```css
.gleantap-form-wrapper,
.gleantap-form-wrapper input,
.gleantap-form-wrapper button {
  font-family: 'Inter', -apple-system, sans-serif;
}
```

Save the form after any CSS change. It applies to every place the form is loaded — embed, standalone URL, and inside Pages.

***

## Tracking Codes

Three separate boxes let you inject scripts at different points:

| Box                 | Fires                                                  | Common uses                                                                |
| ------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------- |
| **Head**            | Loaded in the `<head>` when the form renders           | Google Analytics setup, Meta Pixel init, other analytics tags              |
| **Body**            | Loaded at the bottom of `<body>` when the form renders | Chat widgets, additional scripts, custom logic that needs the form DOM     |
| **Form Submission** | Fires when the visitor submits the form                | Conversion events (GA event, Meta Pixel Lead event, Google Ads conversion) |

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FF7E4lgQQl13UVDotxQQi%2FScreenshot%202023-09-27%20at%203.11.27%20PM.png?alt=media&#x26;token=4ce1dcaf-8d00-4280-bfef-37be9bc97677" alt=""><figcaption></figcaption></figure>

### Example: Google Analytics 4 tracking

**In the Head box:**

```html
<!-- Google Analytics 4 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>
```

Replace `G-XXXXXXXXXX` with your GA4 Measurement ID.

**In the Form Submission box** — fire a conversion event when someone submits:

```html
<script>
  gtag('event', 'form_submission', {
    'form_name': 'lead_capture',
    'value': 1
  });
</script>
```

### Example: Meta Pixel

**In the Head box:**

```html
<!-- Meta Pixel -->
<script>
  !function(f,b,e,v,n,t,s){/* standard Meta Pixel init snippet */}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', 'YOUR_PIXEL_ID');
  fbq('track', 'PageView');
</script>
```

**In the Form Submission box:**

```html
<script>fbq('track', 'Lead');</script>
```

### Example: pre-filling known visitors (autofill)

Gleantap doesn't automatically pre-fill fields for return visitors. If you want that behavior — e.g., for a QR code that a member scans repeatedly and you want their name and email pre-populated — you can add JavaScript in the **Body** box to detect a returning visitor and pre-fill fields.

Two common patterns:

**Pattern 1 — pre-fill from URL parameters.** Link to your form with query params like `?first_name=Alex&email=alex@example.com` (useful when you send a personalized link via email or SMS with merge tags).

```html
<script>
  document.addEventListener('DOMContentLoaded', function() {
    const params = new URLSearchParams(window.location.search);
    ['first_name', 'last_name', 'email', 'phone'].forEach(name => {
      const value = params.get(name);
      if (!value) return;
      const field = document.querySelector(`input[name="${name}"]`);
      if (field) field.value = value;
    });
  });
</script>
```

**Pattern 2 — pre-fill from localStorage.** Store what the visitor entered on their first submission; auto-fill next time on the same device.

```html
<script>
  document.addEventListener('DOMContentLoaded', function() {
    const stored = JSON.parse(localStorage.getItem('gleantap_form_prefill') || '{}');
    Object.entries(stored).forEach(([name, value]) => {
      const field = document.querySelector(`input[name="${name}"]`);
      if (field) field.value = value;
    });
    document.querySelector('form').addEventListener('submit', function() {
      const data = {};
      this.querySelectorAll('input[name]').forEach(f => data[f.name] = f.value);
      localStorage.setItem('gleantap_form_prefill', JSON.stringify(data));
    });
  });
</script>
```

If you're not comfortable writing this yourself, email <support@gleantap.com> — we can help set it up.

***

## UTM parameters are captured automatically

You don't need custom code for UTM tracking. When a form loads with `?utm_source=`, `?utm_medium=`, or `?utm_campaign=` in the URL, Gleantap automatically stores those values on the resulting contact — they show up in the contact's **Source** field.

This means you can:

* Link to the same form from multiple ad campaigns with different UTM values, and see which ad drove which lead.
* Segment new contacts by acquisition source in **Audience → Segments**.
* Report on lead volume by source in your dashboards.

No configuration needed. If a form URL is `https://your.site/form?utm_source=facebook&utm_campaign=summer_promo`, the new contact's Source becomes `facebook` and the full UTM string is preserved for reporting.

***

## Where custom code applies

Your customizations (design, CSS, tracking code) apply everywhere the form loads:

* **Standalone form URL** — the direct link to the hosted form
* **Embedded form** — when embedded via the embed code on your website
* **Advanced Form block inside Pages** — the same form embedded in a Gleantap landing page

You only need to configure the customization once per form. Save the form after your changes.

***

## Related pages

* [Creating a Form](/forms/creating-a-form.md)
* [Embedding Forms](/forms/embedding-forms.md)
* [Adding Forms to Pages](/pages/adding-forms-to-pages.md)
* [Trigger Flows or Campaigns](/forms/trigger-flows-or-campaigns.md)
* [Notifications](/forms/notifications.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.gleantap.com/forms/customizing-design.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
