# How to Verify App Installs with Callback Verification

Enable callback verification to automatically verify if users really downloaded the app. Only participants who have downloaded the app are able to complete this task.

**Follow the steps to enable the callback verification:**

### **Step 1**

To let participants know what the task is, choose one or more tasks and give them a name as a description.

* **Add Single or Multiple Tasks**

You can choose one of the existing tasks or click the 'Custom task' button to add a different task with or without a specific value related to the task. You can also choose or custom multiple tasks for participants to complete in order to join your giveaway.

<figure><img src="https://2708562487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyVxbiaRQCsKiTgC61a7e%2Fuploads%2FfDx7fxtTJ4eYicIBBt9G%2Fsource1.d67a120c.png?alt=media&#x26;token=001932ec-bed1-4f76-8620-5628ae4179f9" alt=""><figcaption></figcaption></figure>

* **Add a Custom Tasks**\
  Moreover, it is also possible to customize tasks and add relevant required amount.\
  \
  Like 3 articles on your website ![](https://2708562487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyVxbiaRQCsKiTgC61a7e%2Fuploads%2FGGJ2e3fYb6LKtFnYNbqh%2Fsource2.b455a924.png?alt=media\&token=f19e2a2d-5c36-4bc2-9092-f100c68a87a0)\
  \
  Then your custom tasks will appear as follows:&#x20;

  <figure><img src="https://2708562487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyVxbiaRQCsKiTgC61a7e%2Fuploads%2Fwb82Xye96Bv3Ny8rE3NM%2Fsource3.1608160a.png?alt=media&#x26;token=477529fe-a5da-45be-bb9a-5845b4f91f16" alt=""><figcaption></figcaption></figure>

### **Step 2**

Then, you need to get url search params from your website and parse out the track\_id.&#x20;

```
track_id=U$MikHklwcY&sign_up=true&invite=true
```

<mark style="color:blue;">**About track\_id:**</mark>

* Every participant will have a unique track\_id, so that we can verify if the participant really complete the required task. The ***?track\_id={{ track\_id }}*** will be used for verification.
* You will see the ***?track\_id={{ track\_id }}\&send=true*** applied to your website link:

For example, if your website link is

```
http://example.com
```

the participants may come to your site via a link like this

```
http://example.com/?track_id=12345_67890&send=true
```

### **Step 3**

Next, please copy the API key we provide you to integrate it with your website.

<figure><img src="https://2708562487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyVxbiaRQCsKiTgC61a7e%2Fuploads%2FPBKVTKZwRQs5IQHJWVe3%2Fimage.png?alt=media&#x26;token=ffe17b45-ee91-4488-8b8d-a0a9502fb274" alt=""><figcaption></figcaption></figure>

Then enter the parameters according to the rules of const data, and encrypt the whole const data using the standard **HmacSHA256** algorithm.

```
const data = `track_id=${track_id}&event=send&remark=${remark}`; // remark is optional.
```

### **Step 4**

Use our official API below and pass the corresponding parameters in the following code.&#x20;

Note: adding a remark is optional.

**Official API:** [<mark style="color:green;">https://giveaway.com/public/v1/giveaway/task/callback</mark>](https://giveaway.com/public/v1/giveaway/task/callback)

```javascript
const api_key = "{{your api_key}}";
const {track_id} = queryString.parse(window.location.search); // url search
const event="send" //your chosen event
const remark = "remark"; //add remark optional
const value="{{your event value}}"
const data = `track_id=${track_id}&event=${event}&value=${value}&remark=${remark}`; // optional
const sign = crypto.HmacSHA256(data, api_key).toString(); // HmacSHA256
fetch("https://giveaway.com/public/v1/giveaway/task/callback", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    track_id,
    sign,
    event,
    remark,
    value
  }),
}).then(async (res) => {
  console.log(await res.json());
});
```

### **Step 5**

After the above steps are completed, enter your url-scheme and click the ‘**Check API callback**’ to test it.

<figure><img src="https://2708562487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyVxbiaRQCsKiTgC61a7e%2Fuploads%2FKYINtAnB8Qtbn7xhD44o%2Fimage.png?alt=media&#x26;token=77345ea4-17e9-46a0-b321-ac8863d4c704" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Each project you created on Giveaway.com will have a unique API key, and it will not change. So you only need to integrate once for a website. Also, you will be able to create tasks on multiple websites if you need to.
{% endhint %}
