# Configuring your campaign

In order to complete Web Opt-In for Kenya, you'll need to configure your campaign on our MobiPay Portal.&#x20;

{% hint style="info" %}
To start you need to modify or create your campaign [here](https://subscription.mobivate.com/campaigns).&#x20;
{% endhint %}

Alternatively navigate to our **Subscription Portal** and click the **Manage Campaigns** button.

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2FYLZgfnCYXAur9gBr3qZf%2Fimage.png?alt=media&#x26;token=52c310cb-c0fe-437c-af71-26079d5ae352" alt=""><figcaption><p>Campaign management screen</p></figcaption></figure>

Click Edit to modify your campaign, or you can click the Create button to create your campaign.

### Configuring your Content Delivery / Billing Frequencies

In our Portal, you have complete customization over your content delivery and billing frequencies.&#x20;

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2FD7RrrjfCbFCzKzxbug0x%2Fimage.png?alt=media&#x26;token=308df773-6197-4167-a861-0b6dc4749436" alt=""><figcaption><p>Content Delivery schedule</p></figcaption></figure>

This allows you to configure when you bill your users for access to your content and at what price.

### Configuring Re-billing Frequencies

Once you have setup an initial time to bill your customers, we would suggest also setting up rebilling requests. These requests allow you to attempt to bill any customers who have not yet been successfully billed for the day.&#x20;

This can be configured under the Rebilling menu.&#x20;

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2FNUn0oqgJUHpCOu1nTriy%2Fimage.png?alt=media&#x26;token=4db39e3c-22e2-48b8-abd3-4c3a6edd8ded" alt=""><figcaption><p>In this case, I am attemtping to rebill my users the 1 hour from my initial billing request above</p></figcaption></figure>

### Opt-In Configuration&#x20;

Is an important part of your campaign's overall configuration as it keeps track of the subscriptions through our system.

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2Fam4gnnpuSwp1VQO8fafI%2Fimage.png?alt=media&#x26;token=c61ff946-8ae6-4893-bade-3619308e86a1" alt=""><figcaption><p>The Opt-In Configuration screen</p></figcaption></figure>

Upon working with Mobivate you will receive a unique keyword or multiple keywords depending on which flows you intend to use. These must be entered here and will look like the following:&#x20;

```
mv-1000000001200 OR secured=mv-1000000001200
```

{% hint style="info" %}
To get your unique keywords, please contact your **account manager**.&#x20;
{% endhint %}

### Event Actions

This section is used to configure your free welcome messages to your customer alongside the technical configuration of your callbacks.&#x20;

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2FYBVPlFtNSEs5TPSzBn7B%2Fimage.png?alt=media&#x26;token=e5adcc87-e85c-4f08-9469-b2d7c22d8a28" alt=""><figcaption><p>Event actions screen</p></figcaption></figure>

In the **Free Welcome Message** and **Free Pause Message** sections, you can dynamically set messages that your users will receive for Subscribing and Unsubscribing to your service. These can also be toggled on and off using the tickboxes.&#x20;

### Receiving callbacks in your endpoints

### Successful subscription callbacks

To configure your campaign to post successful subscription callbacks, you will need to include the rule: **On Subscription Hit URL** under your event actions.&#x20;

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2FQyLTCLJ88GyaEtVAbYR4%2Fimage.png?alt=media&#x26;token=886c2959-a6d0-4a19-b384-d9e52653c5a0" alt=""><figcaption><p>An example Subscription callback configuration</p></figcaption></figure>

### Example request

```markup
https://<hostname>/callbacks/ke/safaricom/?action=subscribed&user=%(MSISDN)&keyword=%(KEYWORD)&service=%(SERVICE)
```

This example request will send the following parameters to your configured endpoint: `action=subscribed`, `user=msisdn`, `keyword=keyword` and `service=service`.

### Successful unsubscription callbacks

To configure your campaign to post successful subscription callbacks, you will need to include the rule: **On Pause (user sent STOP, subscription changed to Inactive) Hit URL** under your event actions.&#x20;

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2FTbnSeLLXOi89nPStDvJy%2Fimage.png?alt=media&#x26;token=6e36a56a-bcb5-4bd2-b2d0-46e5b275348e" alt=""><figcaption><p>An example Unsubscription callback configuration</p></figcaption></figure>

### Example request

```markup
https://<hostname>/callbacks/ke/safaricom/?action=unsubscribed&user=%(MSISDN)&keyword=%(KEYWORD)&service=%(SERVICE)
```

This example request will send the following parameters to your configured endpoint: `action=unsubscribed`, `user=msisdn`, `keyword=keyword` and `service=service`.

### Successful billed callbacks

To configure your campaign to post successful subscription callbacks, you will need to include the rule: **On every positive DLRs hit url** under your event actions.&#x20;

<figure><img src="https://3054861879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUMFodH79sqnxDS9CreuF%2Fuploads%2F5hOpZPVGLomlxxinQi5t%2Fimage.png?alt=media&#x26;token=3adbc08a-3e1a-4b04-86fc-7c68c870361f" alt=""><figcaption><p>An example billing callback configuration</p></figcaption></figure>

### Example request

```markup
https://<hostname>/callbacks/ke/safaricom/?action=billing&user=%(MSISDN)&keyword=%(KEYWORD)&service=%(SERVICE)&cost=%(COST)
```

This example request will send the following parameters to your configured endpoint: `action=billing`, `user=msisdn`, `keyword=keyword,` `service=service` and `cost=cost`.

To differentiate between **billing requests** and **re-billing requests** you can check the cost field as this will be set at different values.&#x20;

{% hint style="info" %}
To understand callback parameters and to see all available parameters, read [our guide here](https://wiki.mobivate.com/mno-web-opt-in/mno-web-opt-in-kenya/broken-reference).
{% endhint %}
