API Master Class #3 Campaign Performance

Welcome to our final API Masterclass! In Part 1 we covered Data Collection, in Part 2 we explained Zone Optimization. In this third API Masterclass, we show you how to evaluate the performance of your campaigns then automatically adjust (up or down) your bids for each one. The aim is for you as an advertiser to use our examples to help get you started using the API and then later, when you feel more confident you can start creating your own examples and tasks.

The spreadsheet
For this tutorial, we will be using two of the sheets on this spreadsheet: ‘Campaign Performance’ and ‘Mock Affiliate Network Data’. The purpose of the spreadsheet is to help you compare campaign data. In addition, some formulas have been supplied in order to estimate new bid values which we will demonstrate in Part 2 of this blog post. The relevant information that you will need from the ‘Mock Affiliate Network Data’ sheet (orange) is some fake data which you can substitute with real data later once you are familiar with how this process works.

So let’s get started!

Step 1
In order to use ExoClick’s API, you must set a Session Token. To set a token, you must have a valid account with the required username and password. The API Token creation is available from the API tab within the Admin Panel.

Step 2
Copy the spreadsheet to your Google Drive and then open it. All of the API coding is done using Google script language, so when you open the spreadsheet simply go to the Tools menu and select Script Editor.

Step 3
Open the ‘Campaign Performance’ sheet and copy and paste your API token in the spreadsheet as shown in the diagram below.

Part 1 – Get Campaign Data

Step 4
Now set the date parameters by adding them into the date fields (Date from, Date to). This will establish the period from which you wish to request the data.

Step 5
Now you can filter your results by cost using ‘ascending’ or ‘descending’ modes by clicking on the field Order by [asc-dec]: In our example, we have chosen ‘d’ for descending. Then select how many campaigns you wish to pull data for by inserting a number value in the Limit field. In our spreadsheet example we have put the Limit at 2, this will pull data for the 2 campaigns we have spent the most money on, because the deciding parameter here is Cost. But you can select as many as you want, however, we recommend you concentrate on the bigger spend campaigns.

Step 6
Then simply click on the Generate Data button on the spreadsheet and the data will be displayed as in our example below:

Part 2 – Update Your Bids
This function allows you to update +/- the bid depending on the data comparison and calculations done in Part 1.

Here is an example of the 2 campaigns we pulled to show you how the formulas work:

In our 2 campaigns you will see that all the green coloured header fields are now filled with the data for that campaign: Campaign ID, Campaign name, Ad Type, Price Model, Bid, Clicks, Impressions, Goals and Cost. As we mentioned before, the orange header fields have been pulled with the mock data from the Affiliate Network, these are your variables. The magenta coloured header fields contain the calculation: D Cost calculates the difference between the campaign’s cost versus the external affiliate cost and D% Cost is the same but in %. In this example you will see it is negative or positive, in this first campaign it is negative at -9.58%. When this value is negative, it means you have to lower your bid, when it is positive you need to put the bid higher. This sheet automatically calculates the new bid for you which you can see under Estimated Value Change.

Step 7 – How to update the bid with the API

To the far right of the spreadsheet you will see the purple header fields, which contain the CID, New Bid and Response Message. The CID is the campaign id that needs to be added manually, the New Bid is a calculation between Current Bid (green) and Estimated Value Change (magenta). Then click the large Update Bid button and the API will automatically adjust your bid price. If the bid has been correctly updated the Response Message will be (“Campaign successfully updated”)

Now, why don’t you try with some real data and see how ExoClick’s API can help you adjust your bids to help you drive those conversions for your offers.

Juanma Cortes

Juanma Cortes