# Creating Rules & Data Elements

Describe what you want in plain language. Ivory generates the components.

## Create a Rule

1. Click **Create** in the Ivory panel
2. Enter your request:

```
Create a rule that fires on page load and sets eVar1 to the page title
```

3. Click **Generate**

Ivory creates all necessary components: events, conditions, and actions.

## Create Data Elements

Same process, different request:

```
Create a data element that captures the value of #user-email
```

Or create multiple at once:

```
Create data elements for page name, page URL, and page type
from the digitalData.page object
```

## Writing Effective Prompts

**Be specific about triggers:**

* "fires on clicks of .cta-button" (good)
* "fires on button clicks" (too vague)

**Specify the data you need:**

* "set eVar5 to page name, eVar6 to page URL" (good)
* "set some variables" (too vague)

**Include conditions when needed:**

* "only on pages where the path contains /checkout"

## Review Workflow

After generation, review each component:

| Action              | Result                                   |
| ------------------- | ---------------------------------------- |
| Approve             | Component created as-is                  |
| Deny                | Component skipped                        |
| Approve All Pending | Approve all remaining components at once |

Only approved components are created in Adobe Tags.

## Batch Creation

Create multiple items in one prompt:

```
Create click tracking rules for:
- Add to cart button
- Remove from cart button
- Checkout button
Each should send an Analytics beacon with the button name in eVar10
```

Each rule appears separately in the review carousel.

## Using Templates

Start from a saved prompt template for common rule patterns:

1. Click **Create** to open the Create modal
2. Select a template from the dropdown in the "Context & Template" section
3. The template text populates the request field
4. Modify as needed and click **Generate**

Templates are managed in the [Ivory web app](https://ivory.moonbird.ai). Learn more about [Prompt Templates](/ivory/features/prompt-templates.md).


---

# Agent Instructions: 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:

```
GET https://ivory-docs.gitbook.io/ivory/features/creating-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
