When I was growing up and deciding what I wanted to study when I went to college, my mother always told me to study math. I remember her telling me that no matter what industry I went into, I’d always be able to find a job because everyone hates math and would hire someone else to do it for them.

It was hard for me to believe at age 16 – in high school, being good at math certainly didn’t make me popular. But just one decade later, I have to admit she was right. Math is the universal language and even in a field like marketing, where my peers spend their days thinking of creative ad copy and keywords, math skills are becoming increasingly valuable to data-driven marketers.

Finally, my time has come! Armed with only a Master’s degree in Applied Mathematics and my trusty Ti-83 Plus calculator, I get to walk the halls of the WordStream office as one of the cool, popular, attractive kids that everyone wants to talk to. (Okay, that may not be true at all. But people here like that I can do math, so that’s nice.)

Now everyone knows that I’m close to the lovely Erin Sagin. But what most people don’t know is that we had a huge falling out a few months ago. She published a very successful post called “Easy AdWords Bidding Strategies for Newbies & Math Haters.” Math haters? Excuse me. I thought we were friends! Needless to say, I felt betrayed:

Don’t worry, Erin and I quickly made up and today (only 5 short months later), I sat down and wrote this blog post.

Math is cool, guys, I promise! Not only will it help you pick up girls at the bar and impress your close relatives, it can also help you hit your client’s goals every time! The best part? You don’t need an advanced math degree or to be a data scientist to figure it out. All you need are these handy equations and a little algebra!

## PPC Formula #1: Setting your CPC bid to hit your Target CPA

First, the definition of CPA, or cost per conversion:

Simple enough, right? Now, let’s take a step back.

Your cost is defined by the number of clicks your ads get multiplied by your cost per click.

And your conversions are just the number of clicks you get multiplied by your conversion rate.

Let’s sub that into our equation:

Interesting. The number of clicks is in both the numerator and the denominator. Let’s simplify this equation:

So, let’s say we knew our target CPA. What CPC would we need to be sure to hit that target CPA? Solving for CPC here means:

Done! So long as we know what our conversion rate is, we can guarantee we hit our CPA goal. For example, if we knew our traffic converted at 2% and we wanted to make sure our CPA was always $25, we know we need to pay $25 x .02 = $0.50 CPC!

## PPC Formula #2: Setting your CPC bid to hit your Target ROAS

Again, let’s start this off simple with the definition of ROAS, or return on ad spend:

Let’s expand this a little further, like what we did with CPA.

Cost is the same as before, the number of clicks your ads get multiplied by your cost per click.

Revenue is a little more complicated. It’s the number of sales (or conversions) you get multiplied by the average order value (AOV) of those sales.

Expanding this one step further, earlier we said conversions can also be written as the number of clicks you get multiplied by your conversion rate. Substitute that into our equation and we get:

Again, we find clicks in both the numerator and the denominator. Let’s simplify:

So now if we know what our goal ROAS is, we can solve for the cost we should be paying per click:

Voila! Now we know everything to set our bid in order to guarantee we hit our ROAS goal. For example, if we needed to hit a ROAS goal of 4.0, our average product sells for $150, and we convert our traffic at 2%, then we know that we need to be paying .02 x $150 / 4.0 = $0.75 CPC.

## PPC Formula #3: Setting your CPC bid to Maximize Profit

Maximizing profit, the CEO’s dream. Here’s where the big boys play! Again, let’s start simple with a definition:

And now, let’s substitute in our earlier expansions of Revenue and Spend:

Revenue being the product of your clicks, conversion rate, and average order value.

Spend is the product of clicks and CPC. This assumes your products are free to produce and ship; if you have additional costs to produce and ship your product, be sure to include them here too!

Ok, we’re talking about maximizing a value, so that means *we need to use calculus*. Don’t freak out, we’ll get through this together! We’re just going to take the derivative of profit with respect to the number of clicks our ads are getting.

Now, let’s solve for the maximum profit. Setting this derivative to 0 will ensure that we’re finding the maximum amount of profit we could potentially drive from our campaign:

>Now, it’s simple algebra for us to find the max CPC bid that maximizes our profit, which is:

Setting your CPC bids to maximize profit is just that simple! It took a little bit of calculus to get there, but all you need is the product of your conversion rate and your average order value. So if you converted traffic at 2% and your average sale was $150, that means your campaigns are most profitable at $3 CPC. Less than $3 CPC and we’re making more profit per each sale, but making fewer sales. More than that and we’re making more sales but losing profit on each additional one.

*QED, PPCers.*

These formulas are mathematically proven to hit your advertising goals! Use them to set and optimize your keyword level bids as well as your bid adjustments and you’re guaranteed to hit your goals and impress your client, boss, and everyone else you know! Isn’t math the greatest?

### About the author:

Mark is a Senior Data Scientist at WordStream with a background in SEM, SEO, and Statistical Modeling. He was named the 14th Most Influential PPC Expert of 2016 by PPC Hero. You can follow him on Twitter, LinkedIn, and Google +.

## Comments

Please don't make light of PTSD triggers.

My sincere apologies, I was genuinely ignorant of the context of that phrase.

I have edited the post appropriately.

These are the best post and well define post. Thanks, Mark Irvine for sharing the idea with us.

Hey Mark, love the post. When thinking about implementing it across my campaigns, I have seen that lowering/raising your CPC bid can affect your conversion rate due to changes in average position. I really like it as a benchmark rule, however.

Hi Harrison,

That's interesting. We've heard people with similar theories in the past, which lead us to look into the myth of average position affecting conversion rate and we don't see that happening all that frequently:

http://www.wordstream.com/blog/ws/2014/05/01/adwords-myths

We absolutely see average position being a major factor in CTR and other SERP factors, but where the ad was on the SERP doesn't seem to affect the rate at which people convert once they arrive on your site.

Great post thank you.....

Very informative post....

Thanks for sharing.

I had to sit and think about the last calculation and whether or not I believed it! I think this assumes a linear corrrelation between CPC and the amount of traffic you receive. It is quite possible to spend 50% more per click and receive 20% more traffic which would mean that it doesn't work.

I am no mathematician though so I might be wrong..

Hey Oliver,

In the 3rd equation, we are relying on an assumption that there is a relationship between CPC and Clicks, which I'll assert is a fair assumption. If we accept that assumption, then we proceed to use clicks as a dependent, indicator variable for CPC.

Because we take the partial derivative of dProfit/dClicks, the relationship between clicks and CPC does not necessarily need to be linear, it just needs to exist.

I agree with you that the relationship between CPC and clicks often looks more cubic than it does linear, particular in top positions!

Thank you for this post. Bid is part of the ad rank equation. But, how does quality score come into play with your formulas?

Hey Jeff,

Good question! As it turns out, quality score won't change these final CPC estimates. At the end of the day, the traffic you're getting has a set value based off your CVR and your AOV.

What quality score will change though, is your ad rank and your ad position, meaning a high quality score will get you more traffic at the same price. That means that increasing your quality score would get you more leads at the same CPC and CPA.

No one told me there was going to be math. At least it was simplified, nice post!

Haha, I'm sorry Jamie. I should have included a warning at the top.

Erin published a post with similar purpose but avoids math as much as possible:

http://www.wordstream.com/blog/ws/2016/05/11/easy-adwords-bidding-strategies

Great post, thanks! Though I did try this out once for a few weeks, reducing my maximum bid per click to something that should maximise ROAS, but I soon found out that there is such a thing as good quality and bad quality clicks. If someone clicks your ad from position 4 or lower, in our experience, they are much less likely to convert...Pah! But it's still great to know the maths!

Hi Ruth,

That's a good point! Not all keywords or traffic types will have the same conversion rate, so it's best to consider this for your most clicked keywords or for setting bid adjustments.

Since you have been provided a nice ranking by PPC Hero I guess I will take your word for it. HA, HA. just joking. Nice set of formulas. I have seen plenty of formulas through the years and this is one of the best break downs of calculating CPC for PPC etc... Really simple to understand and yes your mother is right knowing math whether you like it or not is always necessary. I always tell my daughter to keep up with her math grades even though she does not always do so great with math. I tell her some of the same thing's as I bet your mother told you as well. Great article, a must read for anyone doing PPC and Ad Campaigns.

Thanks Ty,

My mom knows what's up! I'm sure this comment will make her day.

Good cal on CPC forumula

i'm assuming you're not concerned about ranking/position when you want to achieve your desired CPA right?

Hi Steven,

You're correct. These will only help you hit your CPA and ROAS goals. Higher positions will help you get more traffic and leads, but not necessarily at your target CPA.

How does that last one make sense? Using that formula wouldn't maximize profits; it would only allow you to break even, making no profits at all. At $3 CPC and 2% conversion, you'd spend $300 for 100 clicks and then make $300 back in revenue, which is exactly even.

Hi Curt,

That's correct. If all clicks were the same price, that wouldn't make sense. The third equation solves for marginal CPC, the highest you'd be willing to pay for that last sale.

Hi there Mark,

Great post, love it. I've got 1 question though. It's about the third equation.

You say you can calculate the optimal CPC to maximize profits, but how can you be so sure that you're using the optimal CPC?

What I mean is, let's say you bid $4 instead of $3. Sure, you're profit per conversion will go down, but maybe the higher position of your ad will bring you much more visitors, thus leading to more conversions, and more profit overall.

Looking forward to hear your thoughts about this.

Hi Albert,

It's true that increasing your bids would earn a higher position and that would mean more traffic, more sales, and higher revenue!

However, that marginal increase in CPC would imply that your marginal costs would exceed your marginal revenue on those last inframarginal sales. You may still be profitable at the higher bids, but you could be paying too much per click.

If you're going to claim this is mathematics then it's best you state your assumptions. In particular, with your calculus step you assume that all the terms are independent of 'clicks' which I think is a poor assumption.

One of the things that makes cpc difficult is that the quality of traffic, and thus conversion rate, can change drastically when you alter your bids/clicks/rank. High clicks can indicate poor quality and a lower conversion rate whereas low traffic could indicate targeted ads with a high conversion rate.

Simplification is good but there should be (LOTS of) caveats!

Hi Bob!

That's a keen eye! The interesting thing here is that I've actually baked in the assumption that CPC and Clicks share a direct relationship, which I'd argue is a safe one. From there, I don't solve for dProfit/dCPC but for dProfit/dClicks. Effectively, I'm exploiting their shared relationship to solve for CPC using Clicks as an indicator variable.

I also agree that CVR can depend on tons of factors (device, audience, demo, time of day), so these formulas should be used to create bid adjustments based on those segment trends too! One thing we haven't seen though, is a relationship between CVR and Ad Rank or Position, which we looked into in this post:

http://www.wordstream.com/blog/ws/2014/05/01/adwords-myths

Hope that helps!

Mark

If Keyword valuation is given for which CPC - 15, Conversion - 112, CPA - 175 & Average Order Value - 350, then what would be the Cost, Clicks,Conversion Rate, Revenue & ROI for the value? How can we find out this & what would be the formula?

## Leave a comment