# Build Custom Campaigns Using On-chain Data

Spock API allows Web3 projects to build an audience based on purely on-chain data, recognize triggers in real time, and serve custom campaigns tailored to specific user behaviors. With Spock API, you can turn raw blockchain data into actionable insights and personalized engagement.

## Key Features

#### Audience building on on-chain data

* **Segmentation**: Create audience segments based on transaction history, token holdings, and other on-chain activities.
* **Custom criteria**: Use advanced filters to target users based on specific on-chain behaviors like staking, trading, or DAO voting.

#### Real-time triggers

* **Event Monitoring**: Instantly know if a wallet that matches your criteria connects to your dApp.
* **Automated Responses**: Automatically trigger custom campaigns based on these real-time events.

#### How to use it

* Create an audience segment using [Spock Analytics](/introduction/spock-analytics/engage-improve-user-conversion-and-retention.md).
* Get an API that lets you know when a wallet from the segment connects to your dApp.
* Take action on the dApp suitable to your needs.

### Examples of Campaigns

#### Welcome Campaign for New Users

* **Trigger**: A new wallet address interacts with your smart contract.
* **Action**: Automatically serve them a product tour.

#### Loyalty Rewards for High-Volume Traders

* **Trigger**: A wallet address exceeds a certain volume of transactions within a week.
* **Action**: Offer a discount on trading fees, special NFT as a reward, or boosting on farming incentives.

#### Special Offers for DAO Participants

* **Trigger**: A wallet address votes on a DAO proposal related to your project.
* **Action**: Offer exclusive access to a beta feature or a special governance token bonus.

#### Gas Fee Refunds for Failed Transactions

* **Trigger**: A wallet address experiences multiple failed transactions within a short period.
* **Action**: Offer a gas fee refund and a guide on how to avoid common transaction errors.


---

# 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://spock-analytics.gitbook.io/introduction/spock-api/build-custom-campaigns-using-on-chain-data.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.
