How to use the update costs function
Zeno avatar
Written by Zeno
Updated over a week ago

Having accurate cost, revenue and ROI data in your tracker is crucial.

Cost is a somewhat annoying parameter because it is usually available only in detail at your traffic source, often cannot be passed directly in URLs (when bidding CPM, or when you don't want to reveal this data - for good reason), and in general its near impossible to tell your tracker the cost of every click in as much detail as you want.

However inconvenient it may be, manually updating costs is a necessary process if you want to have accurate stats - except of course if you have a direct integration with the traffic source, but such integrations are limited no matter the tracker.

There are two primary modes for updating costs in FunnelFlux:

  • Single mode - used for updating cost with restriction to a single tracking field parameter or combination of these. E.g. updating for a single creative ID

  • Bulk mode - allows for detailed uploads of costs for many different fields and values, e.g. uploading different costs for a dozen creative IDs

In each case with cost updates you will need to select:

  • The campaign

  • The funnel

  • The traffic source

  • The time range

  • The countries (optional - defaults to all)

Let's take a look at a basic single mode upload, then a bulk upload.


Single mode

Below I have selected a campaign, funnel, traffic source, and set the time range to the last 7 days. I have then added a few parameters to restrict the cost update to only clicks that have incoming traffic source parameters of:

  • age=18-24

  • campaign_id=324980423

  • gender=M


I have then elected to update the total traffic cost, so the amount I put will be divided across all visitors meeting these conditions.

So if I have set 152.30 and it so happens that 873 visitors maeet the above restrictions, it will set a cost per entrance (CPE) of 152.30 / 873  for each of those visitors, thus applying a cost of  $0.1745 to each of them.

On the other hand if I toggle to adjust CPE, it will set each entrance to have the cost I put. In general it is much more likely that you'll update the total traffic cost for some parameters than adjust the CPE directly, since you usually work with the cost across some aggregate (e.g. creative7 had 467 clicks and spent $13.39 total).

Now, this is pretty straightforward, but what if you have a campaign with 50 ad sets, or many site IDs, or 100's of creatives?

This is where bulk cost uploads are much more efficient.


Bulk mode

In bulk mode you can upload a text-based list of cost data.

To do this well, its best to use something like Excel, followed by a text editor like SublimeText.

Bulk mode focuses on restricting the cost update based on URL tracking parameters - i.e. the values passed from your traffic source. This is the best way to do it since ultimately your goal is to align cost with the traffic source, right?

That does mean you need to pass data from the traffic source - ideally describing your ad, campaign, ad set, etc. to make cost segmentation as easy as possible.

In bulk mode you should see a text entry box like this:


Here you need to input cost, then a description of what tracking parameters that cost should apply to, and importantly this needs to be separated by ;  symbols rather than ,  symbols, since the latter sometimes appears in tracking field data.

Here's an example of updating cost across many ad_ID values:

56.18; ad_ID; ad1
50.56; ad_ID; ad2
56.18; ad_ID; ad3
16.85; ad_ID; ad4
39.33; ad_ID; ad5
22.47; ad_ID; ad6
39.33; ad_ID; ad7
22.47; ad_ID; ad8
28.09; ad_ID; ad9
44.94; ad_ID; ad10


Here the format defines cost, then the tracking field name, then the tracking field value. If we wanted to then do this for all ad_IDs but only those that also had a campaign_ID of campaign1 , we would change this to:

56.18; ad_ID; ad1; campaign_id; campaign1
50.56; ad_ID; ad2; campaign_id; campaign1
56.18; ad_ID; ad3; campaign_id; campaign1
16.85; ad_ID; ad4; campaign_id; campaign1
39.33; ad_ID; ad5; campaign_id; campaign1
22.47; ad_ID; ad6; campaign_id; campaign1
39.33; ad_ID; ad7; campaign_id; campaign1
22.47; ad_ID; ad8; campaign_id; campaign1
28.09; ad_ID; ad9; campaign_id; campaign1
44.94; ad_ID; ad10; campaign_id; campaign1


With this in mind, you can export detailed data from your traffic source then reformat it in Excel and a text-editor to provide a cost upload statement.

Let's say I export some data from a traffic source for yesterday and it looks like this:

Here I have data for one campaign ID, two separate ad IDs, 10 site IDs for each ad and their corresponding impressions, clicks conversions and cost. You can imagine for a real campaign this could be a spreadsheet with tens of thousands of rows.

Now, from this data, all I care about is the tracking field names/values, and the cost. So, the columns that I need are:

  • the costs (as the first column)

  • campaign_ID, as a column containing just this text repeated

  • the actual campaign_IDs

  • the ad_ID text as a column

  • the actual ad_IDs

  • the site_ID text as a column

  • the actual site_IDs

I need to do the above to make my import easy. So, I will edit things to give me this:

This is loking good -- each row has cost | tracking-field-name | tracking-field-value.

Now I will select the data area (or if huge, delete the header row then use select all, and paste it into my favourite editor SublimeText:

This gives me a tab separated list. Now I can do one of two things to turn it into the exact format I want:

I could use the column select tool to vertically select and change add ;   symbols, or I could select the tab symbol between the columns (the gap), copy it, then hit Ctrl+H for find and replace. Then I could replace these with semicolons:

Hitting replace all then gives me:

...and this is exactly what I need!

So now if we paste this into the bulk update box of FunnelFlux and hit update, it will run through and find all visitors that match campaign_ID x, ad_ID y and site_ID z, then apply a granular cost update for those entrances.


Complicated? At first, yes. But once you are used to doing this you'll find you get into a streamlined flow of the following actions:

  1. Export cost data from traffic source for a specific time-zone and day

  2. In update costs, set to same time-zone and day as well as the specific funnel and traffic source

  3. Open exported cost data, delete and reshuffle columns, add some plain text ones

  4. Copy and paste into text editor, run find and replace

  5. Copy and paste into FunnelFlux, click update

If you want to automate this you can also use the FunnelFlux API and that of other traffic sources to do so.

Did this answer your question?