> For the complete documentation index, see [llms.txt](https://ivory-docs.gitbook.io/ivory/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ivory-docs.gitbook.io/ivory/reference/tips.md).

# Tips & Best Practices

Get better results from Ivory

Get more accurate results with these practices.

## Writing Prompts

### Be Specific

**Good:**

```
Create a click tracking rule for #submit-btn that fires event5
and sets eVar10 to the button text
```

**Vague:**

```
Track the submit button
```

### Include All Requirements

State everything upfront:

* What triggers the rule
* What conditions apply
* What data to capture
* What actions to take

### Reference Context

When you've added items to Workspace:

```
Create a rule similar to the context rule, but for the
newsletter signup form instead of the contact form
```

## Using Element Capture

* Capture the exact element users interact with
* For buttons inside links, capture the button
* For forms, capture the `<form>` element for submit tracking
* Verify the captured selector is unique on the page

## Managing Complexity

### Break Down Large Requests

Instead of:

```
Create all tracking for the checkout flow including cart view,
add to cart, remove from cart, begin checkout, shipping info,
payment info, and order confirmation
```

Do this:

```
Create a cart view tracking rule that fires on page load
when the path contains /cart
```

Then repeat for each step.

### Use Batch Operations Wisely

Batch updates work best when:

* Changes are identical across components
* You've verified the pattern exists in all selected items
* The change is straightforward (selector swap, variable rename)

## Review Carefully

* Always review before approving
* Check selectors match your actual page elements
* Verify variable assignments are correct
* Confirm beacon configuration (page view vs. link tracking)

## After Creation

* Test rules in Adobe Tags's preview mode
* Check that data appears correctly in Analytics
* Publish to a development library first

## Common Mistakes

| Mistake                | Fix                                                  |
| ---------------------- | ---------------------------------------------------- |
| Selector doesn't match | Capture the element again, verify in DevTools        |
| Wrong beacon type      | Specify "link tracking beacon" or "page view beacon" |
| Missing conditions     | Add path or other conditions to limit firing         |
| Variables not clearing | Add "clear variables" action after beacon            |
