# Blockchain

The ReferralHero Blockchain Integration is very powerful and allows you to track and confirm on-chain conversion events for referrals. When a referral meets the defined event their referral status will change from [pending to confirmed](https://support.referralhero.com/campaign-management/subscribers/subscriber-profile#referral-status) and the referral will officially count towards the advocate (ie. points accumulated, rewards unlocked, etc.).

ReferralHero currently supports on-chain tracking for:

* BNB Chain
* Ethereum
* Solana

To use this feature ReferralHero subscribers must have verified crypto wallet addresses.

### Crypto Wallet Address Verification

{% hint style="success" %}
To enable the blockchain integration you must:

1\. Set 'crypto wallet address' as the primary/secondary unique identifier&#x20;

AND

**2a. If you are using our widget to create subscribers**, they must verify their crypto wallet address

OR

**2b. If you are using our Javascript API, REST API, or SDK to create subscribers**, you must send these fields (crypto\_wallet\_address & crypto\_wallet\_provider) to the subscriber profile, as [shown here](https://support.referralhero.com/integrate/javascript-web-api/adding-a-subscriber-manually#add-a-crypto-wallet-address-manually).
{% endhint %}

To enable crypto wallet address verification through our widget:

1. Go to Edit Campaign > Unique Identifier > select Web3 Wallet Address as your primary or secondary unique identifier&#x20;
2. Enable Verification Method > select the crypto wallets you would like to activate to verify wallet addresses

   <div data-full-width="true"><figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FKTP7AavRrWwfFa0KsStt%2Fimage.png?alt=media&#x26;token=2625bcb4-a5bf-456e-9025-c24b437cc53e" alt="" width="563"><figcaption></figcaption></figure></div>
3. Users will now be given the option to connect and verify their crypto wallet address directly through our widget.

<div><figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FyqGPkFqAt9Ww9Wk2Umay%2FScreen%20Shot%202023-08-04%20at%206.08.49%20PM.png?alt=media&#x26;token=518d3129-e1ca-4405-a763-b7d853ff323f" alt=""><figcaption></figcaption></figure> <figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FyV0FQxKP98X4OTvPgZEu%2FScreen%20Shot%202023-08-04%20at%206.09.01%20PM.png?alt=media&#x26;token=e258f83b-d686-40de-963b-d0847c60e54d" alt=""><figcaption></figcaption></figure></div>

4. ReferralHero will automatically check to see if the chosen wallet is activated in the browser extension. If it is, the wallet will automatically connect, and once the 'sign up' is complete the subscriber will be verified.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FnJPUxXAKLwr7gYOjGzht%2FScreen%20Shot%202023-08-04%20at%206.10.17%20PM.png?alt=media&#x26;token=f28d4415-c106-4d4b-b2aa-4e3c1c7d51f2" alt=""><figcaption></figcaption></figure>

### Blockchain On-Chain Tracking

To set up the Blockchain on-chain tracking integration:&#x20;

1. Go to your campaign dashboard > *Edit Campaign > Integrations > Blockchain* and click on **Add Event To Track**&#x20;

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FJuVYEdWGeisKzCLsyA98%2Fimage.png?alt=media&#x26;token=eab97d89-c8cd-4e50-9b9c-4624ee094f80" alt=""><figcaption></figcaption></figure>

2. In the popup, enter the following:&#x20;
   1. Blockchain on which the transaction occurs&#x20;
   2. Name your tracking event&#x20;
   3. Select the conversion value that should be displayed in the subscriber profile&#x20;
   4. Set up as many relevant on-chain definitions&#x20;
3. Click Start Tracking to close the popup Click Save

{% hint style="success" %}
**NOTE:**

* Blockchain integration only works for campaigns set up with ‘multi-step conversion events’ as the campaign goal
* You will not be able to use the Blockchain integration to track events that do not occur on a blockchain, e.g. fiat on-ramp transactions, etc
  {% endhint %}

#### Blockchain On-Chain Tracking Example

The following example illustrates how a ReferralHero on-chain tracking event can be set up:

1. Add the event to track by specifying the blockchain, event name, the conversion event (tokens transferred), and the transaction definitions (e.g. contract address).

<div data-full-width="true"><figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FQoF2Eg7XPcjHy1PQZJWq%2Fimage.png?alt=media&#x26;token=b2373505-cc88-431c-998b-e452a862259d" alt="" width="375"><figcaption></figcaption></figure></div>

2. A referral signs up to your referral campaign, and later performs the required event on BNB Chain.
3. The on-chain transaction occurs and is created on the BNB Chain.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2F1vzgOqZPFXEdePAwpG91%2Fimage2.png?alt=media&#x26;token=ccf515d2-b2c9-4bd7-b495-91cb8d9eceb6" alt=""><figcaption></figcaption></figure>

4. The referral’s status is confirmed and the conversion value is sent to ReferralHero for your onward action.

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FeFqMZ11gn0Ab18bTlP5T%2Fimage4.png?alt=media&#x26;token=416251dc-4278-4ec1-b1b5-8ac54c01a6fa" alt=""><figcaption></figcaption></figure>
