# Conversion Events

{% hint style="info" %}
In order to fully utilize this feature, please make sure you:

* Have a site or app installed in Cookie3 Analytics. [Read more](https://docs.cookie3.com/cookie3-analytics/setup-your-site-or-app)
  {% endhint %}

## **Understanding Conversion Events: OnChain and OffChain Goals**

Conversion events in our system are divided into two categories: **OnChain Conversion Events** and **OffChain Conversion Events**. These two types of goals reflect how we track and attribute key actions that users take, both on the blockchain and outside of it. While the general approach for tracking these events is similar, the attribution process varies depending on whether the goal occurs onchain or offchain.

{% hint style="info" %}
You can learn more about Conversion Events and understand how our attribution model works [in this article](https://docs.cookie3.com/cookie3-analytics/features/conversion-events/how-our-attribution-works).
{% endhint %}

### **OffChain Conversion Events**

Offchain goals occur outside the blockchain, such as signing up for a newsletter, completing a purchase, or submitting a form. For these types of events, we are able to identify the specific visitor who fulfilled the goal based on traditional web tracking methods.

The key to offchain goal attribution is linking the event back to the exact visit that influenced the conversion. By identifying this visit, we can assign credit to the referrer or marketing source responsible for driving the user to complete the goal. Our attribution process ensures that the correct marketing touchpoints receive credit for the conversion.

### **OnChain Conversion Events**

Onchain conversion events, such as completing a transaction or interacting with a smart contract, present a unique challenge because they occur directly on the blockchain. In these cases, we do not have direct information about the visitor who performed the onchain action, only the wallet address involved.

To solve this, we match the onchain action with the visitor by identifying website visits where the wallet in question was connected. Here’s how the process works:

1. **Search Website Visits**: We go through all the website visits to find instances where the visitor connected the wallet that was used to complete the onchain goal.
2. **Select the Closest Visit**: Once we have a list of visits where the wallet was connected, we select the visit closest to the goal completion date to maximize accuracy.
3. **Identify the Visitor**: After selecting the visit, we match it to the visitor responsible for the action. While we cannot directly link the wallet action to a specific user, this method ensures we associate the goal with the most relevant visitor activity.
4. **Apply Attribution Model**: After identifying the visit, we use the same attribution model as for offchain goals to credit the proper referrers and marketing sources.

**Conclusion**

By dividing conversion events into onchain and offchain categories, we ensure that every conversion, regardless of where it happens, is accurately tracked and attributed. While offchain goals allow us to directly identify the visitor, onchain goals require us to leverage wallet connection data to make the best possible attribution.

If you’re interested in learning more about how we attribute conversions, check out our detailed article on [Attribution Models](https://www.notion.so/a7c618797d81456680056ffe8d0ca164?pvs=21).


---

# 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://docs.cookie3.com/cookie3-analytics/features/conversion-events.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.
