> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracklysms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TUNE/HasOffers Integration

> Sync offers and conversions from TUNE

Trackly integrates with TUNE (formerly HasOffers) to automatically sync offers and pull conversion data.

## Overview

The integration provides:

* **Offer sync**: Import offers from TUNE
* **Conversion tracking**: Conversions pulled via `Report/getConversions` API on a schedule
* **Revenue sync**: Automatic payout updates

## Setting Up

### Step 1: Get TUNE Credentials

In your TUNE dashboard:

1. Go to **Settings > API**
2. Create or copy your `NetworkToken`
3. Note your network ID

### Step 2: Add Integration in Trackly

1. Go to **Integrations**
2. Click **Add Integration > TUNE/HasOffers**
3. Enter:
   * **Network ID** (`network_id`)
   * **Network Token** (`network_token`)
   * **Base URL** (`base_url`) — your network's TUNE domain (e.g., `https://clicks.itstracking.com`)
   * **Affiliate ID** (`affiliate_id`) — your affiliate ID in the network
4. Click **Test Connection** to verify credentials
5. Save the integration

You can also configure:

* **Message ID Field** (`message_id_field`): Which HasOffers field carries the Trackly message ID for conversion attribution. Default: `aff_sub`. Valid values: `aff_sub` through `aff_sub5`, `affiliate_unique1` through `affiliate_unique5`, `source`.
* **Global URL Params**: Parameters appended to every offer URL, supporting macros: `{{messageId}}`, `{{offerId}}`, `{{externalId}}`

### Step 3: Configure Conversion Tracking

Trackly syncs conversions from TUNE **hourly** via the `Report/getConversions` API with a 7-day lookback window. The sync uses a two-pass revenue bridge:

1. **Primary**: The `ad_id` on the TUNE conversion is looked up as a `click_id` in Trackly's click tracking, resolving to the original message
2. **Fallback**: The configurable `message_id_field` (default: `aff_sub`) carries the direct 8-character message ID

### Step 4: Configure Postback URL (Optional)

For offers you manage directly, configure a postback URL in TUNE pointing to Trackly's conversion endpoint. The postback URL format and macros are generated in the offer's **Postback Config** section.

## Offer Sync

### Manual Sync

1. Go to **Offers**
2. Click **Sync from TUNE**
3. Select offers to import
4. Click **Import**

### Automatic Sync

Enable automatic sync:

1. Go to **Integrations > TUNE**
2. Enable **Auto-sync offers**
3. Set frequency (daily, hourly)

Synced offers update automatically.

## What Syncs

| TUNE Field      | Trackly Field |
| --------------- | ------------- |
| Offer name      | Name          |
| Destination URL | Tracking URL  |
| Default payout  | Payout        |
| Payout type     | Payout type   |
| Advertiser      | Advertiser    |
| Status          | Status        |

## Conversion Tracking

When conversions are pulled from TUNE:

1. Trackly calls the `Report/getConversions` API on a scheduled basis
2. System receives `click_id` and `payout` from conversion data
3. System matches to original click
4. Revenue attributed to message/creative/offer

### Required Parameters

Your tracking URLs must pass `click_id`:

```
TUNE click URL: https://track.tune.com/aff_c?...&aff_sub={click_id}
```

The `{click_id}` is replaced with Trackly's click identifier.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Offers not syncing">
    Check:

    * API credentials are correct
    * Network ID matches your account
    * API access is enabled in TUNE
  </Accordion>

  <Accordion title="Conversions not tracking">
    Verify:

    * TUNE API credentials are valid and have report access
    * `click_id` parameter is being passed in tracking URLs
    * Conversion sync schedule is running
  </Accordion>

  <Accordion title="Payout mismatch">
    TUNE payouts may differ from Trackly if:

    * Sync hasn't run recently
    * Offer has custom payouts per affiliate
    * Currency conversion is involved
  </Accordion>
</AccordionGroup>

## Multiple TUNE Accounts

If you have multiple TUNE networks:

1. Add each as a separate integration
2. Prefix offer names to distinguish
3. Conversion sync runs independently per network

## Best Practices

<AccordionGroup>
  <Accordion title="Sync before campaigns">
    Run a sync before launching campaigns to ensure offers are current.
  </Accordion>

  <Accordion title="Verify conversion sync">
    Check integration logs to verify conversions are being pulled correctly from TUNE.
  </Accordion>

  <Accordion title="Monitor sync logs">
    Check integration logs for sync errors or missing offers.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Revenue Tracking" icon="dollar-sign" href="/guides/offers/revenue-tracking">
    Attribution and reporting
  </Card>

  <Card title="Offers Overview" icon="tag" href="/guides/offers/overview">
    Offer management basics
  </Card>
</CardGroup>
