# How can I set it so that it only appears if the visitor hasn't submitted the form on my landing page?

Canonical URL: https://support.optimonk.com/en/articles/how-can-i-set-it-so-that-it-only-appears-if-the-visitor-hasn-t-submitted-the-form-on-my-landing-page

There are two different situations behind this question, and they have two different answers:

- the form is **your own**, sitting on your landing page → you store the fact of the submission in a cookie, and target on that cookie;
- the form is **inside an OptiMonk popup** → you don't need any code, the **Engaged with OptiMonk campaigns** rule (or the frequency setting) already knows who filled it in.

Both are set in the campaign's **Settings** tab.

---

## Where the targeting rules are

1. Open **Campaigns** in the left menu and click the campaign.
2. Open the **Settings** tab.
3. The middle section is **Who should see the popup**. Rules there are combined with AND — every rule has to match for the popup to show.
4. Click **Add new rule** to add one, and **Save changes** at the bottom when you're done.

Tip: you can also ask the assistant on the right to change these (for example: *"only show to visitors who haven't filled my signup form"*). The cards below update as it edits them.

---

## Case A — your own form on your landing page

The trick is to remember the submission yourself, in a cookie, and then tell OptiMonk to skip anyone who has it.

### 1. Set a cookie when the form is submitted

Add a few lines to your own page so that a successful submit writes a cookie. For example:

```
<script> document.getElementById('my-form').addEventListener('submit', function () { // name=value; keep it for a year; valid for the whole site document.cookie = 'form_submitted=1; max-age=' + 60 * 60 * 24 * 365 + '; path=/'; }); </script>
```

Use whatever cookie name and value fits your site — OptiMonk only reads it. If your form posts to a thank-you page, setting the cookie on that page is just as good, and it is the safer option when the submit can still fail validation.

**Important:** the cookie only starts to exist from the moment this code is live on your site. Visitors who submitted the form earlier have no cookie, so the popup can still appear to them once.

### 2. Add the Cookie segmentation rule

1. In the campaign's **Settings** tab, under **Who should see the popup**, click **Add new rule**.
2. Pick **Cookie segmentation** — *Target by browser cookie values*.
3. In the rule, fill in one condition:

- the cookie name (`form_submitted` in the example above) in the first box,
- the value type — **text** or **number**,
- the operator: **is not set** if you only care whether the cookie exists, or **not equals** with the value `1` if you write different values into the same cookie.
4. Click **Save** on the modal, then **Save changes** at the bottom of the page.

The rule card then reads *Cookie segmentation · Cookie form_submitted is not set*, and the settings summary shows **Cookie targeting (1 conditions)**.

### More than one condition

Inside the modal you can build several conditions:

- **Add AND condition** puts another condition in the same group — all of them have to match;
- **Add OR group** starts a new group — the rule matches if any group matches.

As the modal says: *Conditions inside a group are AND-ed; groups are OR-ed. "is set" / "is not set" check only whether the cookie exists.* A rule can hold at most 10 OR groups.

The operators offered depend on the value type: **text** gives *equals, not equals, contains, not contains, is set, is not set*; **number** gives *equals, greater than, less than, at least, at most, between, is set, is not set*.

---

## Case B — the form is in an OptiMonk popup

Then nothing has to be coded. Two options, depending on what you want:

### The simplest: stop showing after a conversion

In the campaign's **Settings** tab, open **How often can it appear** and tick **Stop showing** → **after a visitor has converted**. From then on, whoever fills in this popup won't see it again.

### Across campaigns: the Engaged with OptiMonk campaigns rule

Use this when the form is in a *different* campaign — for example a full-screen welcome popup — and you want a second campaign to show only to visitors who never filled that one in.

1. **Who should see the popup** → **Add new rule** → **Engaged with OptiMonk campaigns** (*React to how visitors met your other campaigns*).
2. In the modal, under **Campaign interactions**, the condition reads as one sentence: **If the visitor has** … choose

- the state: **not converted in** (the other states are *seen, not seen, closed, not closed, converted in,* and *filled a form*),
- the campaign: **any** campaign, **this** campaign, or a specific one from the list,
- the time window: **in this session** or **ever before**.
3. Save the modal, then **Save changes**.

### Targeting on what they answered

The same rule has a seventh state, **filled a form**, which matches an answer instead of a campaign. Pick the input field (**Select input**), an operator (*equals, doesn't equal, contains, doesn't contain*), and the value — the card then reads *Filled a form where Email contains @company.com*. Use it when "has submitted" is not enough and the answer itself decides who sees the campaign.

---

## What is not available

The classic **Custom Attribute** / visitor-attribute targeting (pushing your own visitor variables into OptiMonk with JavaScript and matching on them) is not part of this app's rule set. If a campaign you imported from the classic admin uses such a rule, it is kept exactly as it is and shown as a non-editable card — *Managed in the OptiMonk admin — kept as-is, not editable here* — so saving this page never destroys it. To change it, open the classic admin.

For the case in this article, you don't need it: a cookie does the same job and is readable by the **Cookie segmentation** rule.
