> 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/how-to-guides/prompt-examples.md).

# Prompt Examples

Ready-to-use prompts for common tracking scenarios

Copy and customize these prompts for common tracking scenarios. Replace the `[PLACEHOLDER]` values with your specifics.

## CTA Button Tracking

```
Create a click tracking rule for [BUTTON SELECTOR].
Set eVar[X] to "[CTA NAME]".
Fire event[X].
Send a link tracking beacon with link name "[CTA NAME]".
Clear variables after the beacon.
```

## Form Submission Tracking

```
Create a rule that fires on form submit for [FORM SELECTOR].
Set eVar[X] to the form name "[FORM NAME]".
Set eVar[X] to the page URL.
Fire event[X] for form submission.
Send an Analytics beacon.
Clear variables.
```

## Page Load Tracking

```
Create a page load rule that fires on DOM ready.
Only fire when the path contains [PATH].
Set eVar[X] to page name, eVar[X] to page type.
Fire event[X].
Send a page view beacon.
```

## Outbound Link Tracking

```
Create a click tracking rule for links starting with "http"
that don't contain [YOUR DOMAIN].
Set eVar[X] to the link URL.
Set eVar[X] to the link text.
Fire event[X] for outbound link.
Send a link tracking beacon.
```

## Video Tracking

```
Create a rule that fires on the custom event "[VIDEO EVENT NAME]".
Set eVar[X] to the video name from [DATA LAYER PATH].
Set eVar[X] to video action (play/pause/complete).
Fire event[X].
Send a link tracking beacon.
```

## Error Tracking

```
Create a rule that fires on the custom event "error".
Set eVar[X] to error message from [DATA LAYER PATH].
Set eVar[X] to error code.
Set eVar[X] to page URL.
Fire event[X] for error tracking.
Send a link tracking beacon.
```

## Scroll Depth Tracking

```
Create a rule that fires on the custom event "scroll_milestone".
Set eVar[X] to scroll percentage from [DATA LAYER PATH].
Set eVar[X] to page name.
Fire event[X].
Send a link tracking beacon.
```

## E-commerce: Add to Cart

```
Create a click tracking rule for [ADD TO CART SELECTOR].
Set eVar[X] to product name from [DATA ELEMENT].
Set eVar[X] to product ID from [DATA ELEMENT].
Set eVar[X] to product price from [DATA ELEMENT].
Fire event[X] for add to cart.
Send a link tracking beacon with link name "add to cart".
```

## E-commerce: Purchase Complete

```
Create a page load rule for the order confirmation page.
Only fire when path contains [CONFIRMATION PATH].
Set eVar[X] to order ID from [DATA LAYER PATH].
Set eVar[X] to order total from [DATA LAYER PATH].
Fire event[X] for purchase.
Fire purchase event with products string from [DATA ELEMENT].
Send a page view beacon.
```

## Internal Search Tracking

```
Create a page load rule for search results pages.
Only fire when path contains [SEARCH PATH].
Set eVar[X] to search term from [QUERY PARAM OR DATA LAYER].
Set eVar[X] to number of results from [DATA ELEMENT].
Fire event[X] for internal search.
Send a page view beacon.
```

***

## Save Your Own

Use these examples as starting points, then save your own templates for prompts you use repeatedly. See [Prompt Templates](/ivory/features/prompt-templates.md) to learn how.
