Adsterra Integration
Connecting Adsterra to Rinku lets you block and unblock placements in your Adsterra campaigns straight from Rinku, either with one click from an alert or automatically when an optimization rule fires. In Rinku, an Adsterra placement is a zone.
Before you start
- API token. You generate the token yourself in your Adsterra account, no account manager needed. See step 2.
- Plan. Ad network integrations are part of the Expert plan, and you can use them during the 14-day free trial.
1. Create the source
- Go to Sources and click New Source.
- Pick AdsTerra from the list of networks.
The input parameters are filled in for you:
| What | Adsterra macro |
|---|---|
Click ID (net_external_id) | SUB_ID_SHORT(action) |
Zone (net_source) | PLACEMENT_ID |
Publisher (net_pid) | PUBLISHER_ID |
Creative (net_creative) | BANNER_ID |
Network campaign (net_campaign) | CAMPAIGN_ID |
Advertiser ID (token_1) | ADVERTISER_ID |
Landing ID (token_2) | LANDING_ID |
Campaign name (token_3) | CAMPAIGN_NAME |
Publisher's site ID (token_4) | ZONE_ID |
You don't need to add the ## around the macros: Rinku adds them in the campaign link, for example ##PLACEMENT_ID##, and Adsterra replaces them with real values.
The zone and the network campaign are what Rinku uses to block a placement in the right Adsterra campaign, so keep them in your tracking link.
2. Connect your Adsterra account
First, get an API token in Adsterra:
- In your Adsterra account, click your account name in the top right corner and choose Settings.
- Open the API tab and click Generate token.
Then, in the Rinku source form, open Connect external account, choose Connect new account and paste the token into the API key field. Rinku checks the token before saving, so you know straight away whether it works. Save the source with the connected account selected.
Adsterra allows up to 5 active tokens per account. If you already have 5, delete one of them before generating a new one. Each token is valid for one year from its creation date: when it expires, generate a new token and reconnect the account in Rinku.
3. Postback
The Adsterra source comes with a postback template for sending conversions back to Adsterra:
https://www.pbterra.com/name/{YOUR ACCOUNT NAME}/at?subid_short={net_external_id}&atpay={payout}
Replace {YOUR ACCOUNT NAME} with your Adsterra account name, the one shown in the top right corner of your Adsterra account. The postback is sent only for conversion records that your offer settings count as conversions. It matters if you buy on CPA or use CPA Goal rules, because that is how Adsterra sees your results.
4. Costs
Spend is calculated from the cost model you set on the Rinku campaign:
- CPC if you buy by clicks or impressions. For Popunder bought on CPM, each opened window is one click, so a $2.50 CPM means a cost of $0.0025 per click.
- CPA if you buy on conversions.
CPA Goal in Adsterra is a set of optimization rules on top of CPM or CPC traffic, not a pricing model: you still pay per impression or click, so use CPC on the Rinku campaign.
The price you actually pay changes by placement and over time, so the cost on the campaign is an estimate. To replace it with real spend, import your Adsterra statistics into Rinku:
- In Adsterra, open Campaigns & Statistics and switch to Statistics.
- Set the date range, pick the campaign in Campaign, and choose Placement in Group by. Click Apply.
- Click the download icon above the table and choose Download as CSV.
- Prepare the file before importing it:
- Remove the
$sign from the Spent column. Adsterra exports amounts as$0.047, and Rinku reads values with a currency symbol as 0. Open the CSV in a text editor, replace$with nothing and save. Don't resave the file in Excel, so placement IDs stay as they are. - Remove the
Totalrow at the end of the file.
- Remove the
- In Rinku, import the file on the campaign and map the columns:
| Rinku field | Adsterra column |
|---|---|
| Source (net_source) | Placement |
| Clicks | Impressions for Popunder, Clicks for Social Bar, In-Page Push, Native and banners |
| Costs | Spent |
On Popunder, Adsterra counts impressions and the Clicks column stays at 0, while in Rinku each opened window is a click. That's why you compare Rinku clicks with Adsterra impressions. The Clicks field is only shown for comparison and doesn't affect the calculation.
See Reconciliation for the import steps and how the costs are recalculated.
5. Blocking and unblocking zones
Once the source has a connected account, the actions in Alerts and the Optimization tab work through the Adsterra API:
- Block adds the placement to the blacklist of that specific Adsterra campaign. When several zones of one campaign trigger, Block All blocks them in one go.
- Automatic blocking. Turn on Auto for the campaign in Campaigns, and Rinku blocks zones as soon as a rule fires, without waiting for you. If the API call fails, the alert shows that automatic blocking failed and the zone stays triggered.
- Unblock removes the placement from the campaign's blacklist, and the zone starts receiving traffic again. Rinku then checks the zone against the rule with current data and flags it again if it still meets the conditions.
Conversions that arrive after a block are still credited to the zone, so use the Conversions since block column to spot zones worth returning.
Troubleshooting
| Problem | What to do |
|---|---|
| Connection fails when saving | Check that you copied the whole token and that it is active in Settings → API in Adsterra |
| You can't generate a new token | Adsterra allows 5 active tokens. Delete one you don't use, then generate a new one |
| The connection stopped working | The token may have expired or been deleted. Generate a new token and reconnect the account |
| Block or Unblock returns an error | Check that the Adsterra campaign still exists and that CAMPAIGN_ID is passed in the tracking link |
| The campaign runs on a placement whitelist | Block adds placements to the campaign's blacklist and doesn't check how the campaign is targeted. Don't use Block on Adsterra campaigns that run on a placement whitelist |
| All costs became 0 after importing a CSV | The Spent column still has the $ sign. Remove it in a text editor and import the file again |