How to Disavow Links – The Ultimate Guide

As we know, in modern times, backlinks are one of the most important factors when it comes to SEO. In this tutorial, we are not talking about acquiring backlinks, but removing them. Why would we remove them? Well, not all links are good backlinks, bad backlinks come with a spam score which gives you a negative score or a spam score. This is why it is good to use the disavow tool to remove unwanted backlinks.

Unlike some other topics, Google has been quite forthcoming on their backlink disavowal views and its place in your search engine optimisation toolbox. Let’s look as to why you may want to disavow a link and how we go about using the tool.

Why Should We Disavow Links?

If your spam score is increasing or poor backlinks are having a negative effect on your SEO, then the disavow tool is what you should be using. If you receive a message from Google in your Webmaster Tools about having ‘Unnatural Links’, you are being penalised whether you are knowingly complicit or not.

An important role for any SEO export is addressing any Google penalties that may arise. It’s not an issue if you stick to white hat SEO, but knowing how to keep a clean backlink profile for your website is vital when it comes to your SEO strategy.

Another great tool you can use to monitor negative backlinks is Moz Domain Analysis tool. This will provide you with metrics for your PA (Page Authority), DA (Domain Authority) and a Spam Score which is all ranked between a value of 1-100. However, I am going to mention here that if we disavow links in Google’s Disavow Tool, it will not take effect on Moz. We are simply using this tool to check which links we could potentially disavow. Unfortunately, Moz doesn’t have any access as to which links have been disavowed from Google, so just within Moz; it won’t reduce your spam score.

We, unfortunately, will not detect that a link has been disavowed, this isn’t something we were able to include in the old or new DA models. Since disavowing links doesn’t actually remove a link, it just signals to Google that the links aren’t important, our crawler will continue to find the link. We are working on having something like that built into Link Explorer, where if you disavow a link in Google, you can also mark it as disavowed in Moz, but I’m afraid that option isn’t available yet.

So, what constitutes a healthy backlink profile?

In general, the majority of organic backlinks can be classified as ‘good backlinks’. They represent the ideal Internet that Google is looking for. One where the website has great content is referenced frequently, naturally and freely. A single backlink won’t really have a big impact on your website, but they will slowly be building a reputation for your website and acknowledge your website to be a trustworthy and authoritative source.

On the other hand, ‘bad backlinks’ are mostly non-organic (with few exceptions). Two of the biggest offenders of this are where people decide to purchase backlinks in a mass order from shady websites. This, and intentional backlink schemes which utilise a private backlink network (PBN). You can read more about this in this article: What do I need to know about buying backlinks in 2020?.

It is also possible to gain ‘organic’ links from spammy websites that are just lists of products and links with no real content. The link was most likely generated by a script/robot, and it is certainly not benefitting your site, in which case, these are the ones we want to be removing.

Negative SEO Attack

Just to add here, with disavowing backlinks, you have to be really careful. It is a serious action. that can significantly impact your search ranking, whether it’s for the better or worse, so be very careful with the links you wish to disavow.

Google considers it a pretty last-resort option. You can find this in Webmaster Tools > Advanced and there are 3 warning screens you have to click through before you can upload a disavowal file.

In general, you should only disavow a link that you know for sure is bringing you down. Check the Google Quality Guidelines for a more exhaustive list.

Note that a link from a low-traffic or low domain authority site is not a bad link. It probably won’t contribute much individually, but every link is a vote of confidence in your site that Google takes into account. Obviously high ranking PA / DA websites will increase your score quicker, but a thousand low-quality PA / DA websites linking to your website is also helping you as well.

So, What Happens When You Disavow a Backlink?

Essentially, this is a request for Google to ignore those links to your domain. If the link disavow is successful, it won’t be counted for or against you when determining ranking in the search results.

Do note, Google is not obligated to honour your request to disavow the links. If you have a look in their documentation, you will see that it is only a suggestion to disavow the links that you are requesting. Also, this can take up to 48 hours before it takes effect on your websites search ranking.

Is it possible to undo a link disavow?

It is indeed. You are always able to download your current disavow file and edit it to your requirements. I wouldn’t edit it too frequently, you really want to be sure that the links in which you want to disavow are the right ones and the ones you wish to stick with.

How to do I Disavow Links in Google Search Console?

If you have a Google Analytics tracking tag on your website then you will also have access to Google’s Search Console tool.

Within the Google Console, you can conduct a link audit from the Link Report page. Just click the Export External Links button on the top right of the screen then select the More Sample Links option. You can export this file if you wish as well.

Once you have determined which links you are sure you wish to disavow, you will need to create a text file (*.txt) which you can upload to the Google Disavow Tool. With this, you need to follow a specific format but it’s really simple. The format goes as follows:

  • Each entry has to be on a different link
  • Each entry needs to begin with domain:
  • You can name the filename of the text file as anything you like

Following these rules, here is an example of how you can block either a complete domain or just a specific page:


# Pages to disavow
https://spam-website.com/this-is-a-bad-link
https://spammy-website.com/oh-damn-another-bad-link

# Domains to disavow
domain:spam-website.com
domain:super-spammy.org

Blacklisting the entire domain will save you quite some time over blocking just a specific URL. However, there are few instances in which you would want to disavow a single link from a site but still allow other links from that domain, but that’s why the option is available.

Head over to the Google Disavow Tool, select your domain and click through all of the warnings prompts until you reach the dialogue box that allows you to browse your folders and choose a file to upload. Select the disavow file you already created, and select Open to upload it to the disavow tool.

Within the next day or so, Google will no longer take the listed domains into account when determining your pages’ ranking.

Conclusion

Disavowing links can be intimidating if you don’t know what to do, so be sure you know what you are doing before adding a list of domains/pages. You can potentially ruin your SEO if you abuse disavowing, so it’s crucial to get it right.

We think every site owner needs to know about disavowing. It can mean the difference between a clean link profile and a spammy one. Plus, there are so many benefits to disavowing links correctly. Why? Well, your website will most likely get a book in ranking which will result in a higher ranking and more traffic to your website.

As already mentioned though, you don’t want to disavow links if you can help it; a manual removal is always preferable.

Only disavow links when you have no other choice. In this case, don’t be afraid to use the Disavow Tool, at the end of the day, that’s why it’s readily available.

Hopefully, you have a better understanding of why you should disavow links and when you should do it. It can be a bit of a daunting task, but once you get used to it, it’s super easy.

Has the disavow tool ever helped you in the past? How much did it improve your rankings? Let us know! 🙂

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well of many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

What do I need to know about buying backlinks in 2020?

Have you ever had someone say to you that they’ve had a sudden decrease in rankings on their website? Everyone wants to rank on the first page for certain keywords on the search engine results page (SERP), and if you’ve been there before, you’ll realize how impactful this is on traffic and revenue coming through to your website.

There are various reasons why this could happen, more commonly because of the use of low-quality or bad backlinks which can be considered as spam. These low-quality links are usually caused by website owners purchasing backlinks for their website. If you consider the amount of time, effort and money people have to make to build website traffic, a sudden negative impact due to poor backlinks is known to disrupt the operation of their business, both mentally and financially for that matter.

Before we get started, we’re going to mention a great tool we like to use to monitor the performance of our website called Moz. You can also download their browser extension here which makes it easier to analyse your domain. What this will do is provide a score for your domain, and you will receive a score for DA, PA and it will give you a spam score as well.

PA & DA stand for Page Authority and Domain Authority, respectively. These are numeric metrics which are both scored out of 100. Quite often, they are used to see how search engines see the strength of backlinks by a particular URL. However, Google does not use PA or DA as ranking methods. From this information though, you can think of Moz as a third-party metrics to get an idea of what your PageRank might look like.

There are similar link-graph metrics from other third-party tools as well such as:

  • Ahrefs DR & UR
  • Domain Rating & URL Rating
  • Majestics TF & CF
  • TrustFlow & CitationFlow

Which ones should you use? Well, it all comes down to personal preference. Some SEO’s use these metrics, some don’t trust link-graph metrics at all or think they’re useless.

Personally, we prefer Ahrefs & Majestic metrics as we’ve worked at a web-host previously and got a taste for the scale of different bots in practice. Moz doesn’t actually crawl that much. Ahrefs & Majestic have a much larger crawl infrastructure, so I would trust them more… But again, the choice is down to you!

You can read more about Link Building on one of our previous posts here.

So, what are backlinks anyway?

Backlinks are links from one website to another website. Google and other search engines consider backlinks as a vote of authenticity. Basically, if another website links to you, it means that website is giving you a ‘vote of trust’. If you have thousands of backlinks linking to your website, this ‘could’ increase the worth of the page in the eyes of any search engine. One thing you have to understand though is that a few backlinks from reputable websites are going to be worth a lot more than several links from unreputable sites. How can we determine if a site is reputable? Well as we mentioned before, we can use certain tools to get an idea of how ‘worthy’ a backlink is.

Let’s look at Facebook for example:

Facebook, at the time of writing, has a PA of 100 (perfecto!), DA of 96, 1,601,867,432 backlinks, and only a spam score of 1%. Pretty incredible right?

Since the advent of the search engines and the rise of Google, backlinks have remained instrumental in ranking the website. Despite regular changes in the search engine algorithms, experts still regard the number of quality backlinks as one of the most important factors of any website.

That being said, how did backlinks become of such great importance for a website? It wasn’t always like this but here is a bit of history of backlinks.

History of Backlinks

Once upon a time ago, search engines such as AskJeeves, Yahoo, AOL, Excite amongst a few others dominated the search landscape. For this reason, developers of search engines were always trying to find a way in which they could rank websites based on the quality of information that appeared on that website. In the beginning, search engines started by ranking websites based on the number of keywords for the particular website.

In these golden days, whenever somebody searched for something, the top-ranking web page on search engines would be pages that had the most relevant keywords to that particular keyword search. Let’s say you were to search for ‘Website Design’, this would normally rank a web page based on the number of keywords for Web Design and similar terms for a particular page. What was the issue? Well, this method of ranking led developers to do things such as ‘keyword stuffing’. What this means is that a lot of people would then stuff their website with hundreds of keywords on every page of their website just to gain priority (or even a top-ranking) on search engines for a particular search term. What this meant was that a lot of low-quality websites would start appearing quite highly ranked up even if the website wasn’t even about that given topic, crazy right?

Not only that, but to keep the look and feel of a web site, people were actually hiding these keywords, placing them off then screen (let’s say like 9999px to the left) just to get a higher ranking and increased web traffic.

This is when Google first came into the spotlight back in 1998. Their objective was to change how the information is presented to the user in search listings. Over time, Google started putting more emphasis on backlinks instead of keywords. Why? Well, there were obviously some flaws before and it’s not quite as easy to ask other website owners to link to a particular page on your website; because of this, the number of backlinks was a preferred method over keywords and other factors.

It was a very wise thing to do: if you look at big companies such as Apple, Amazon, CNN, and so on, they all had one major thing in common. They had thousands of backlinks. For Google, this was an awesome start as people were then shown information from authority websites that had more relevant information based on their search terms.

Over time, people were also finding ‘hacks’ to gain a higher ranking. This resulted in business owners purchasing backlinks from companies that could sell them in bulk and given more emphasis on keywords (with a link to their website) that people wanted to rank for. As a result of this, it once again became possible to climb up the search engine ladder and reaching the top page once again quite easily.

This obviously challenged Google to address another problem. What they did to tackle this was that they started blacklisting websites, decreasing their rank, or in more severe situations, just outright blocking the website. This meant a lot of websites suddenly noticed a massive decrease in their rankings.

For some websites, it meant losing thousands of pounds of revenue for just a single day’s operation. For others, it meant restarting their journey from the ground up again. Even today, Google and other prominent search engines are proactively changing their search algorithms to stop website owners from dodging the system.

To get a better idea of how you can rank for SEO these days, you should check out this blog post: The 4 best SEO practices for 2020 and beyond.

So, should I buy Backlinks?

Well, since Google and many other search engines now put a huge emphasis on backlinks, it’s quite obvious that many website owners will feel pressured into buying them.

They continue to buy them because it saves a lot of time and helps them get results faster. But there is a problem here…

Google and other search engines will eventually catch on to this, which can lead to their website becoming penalised which can even lead to established websites becoming bankrupt because of this.

Google does have some clear guidelines regarding link-building schemes. These guidelines are regularly published by SEO companies and experts who try to steer people away from buying backlinks. Unfortunately, some website owners don’t take any notice of this, assuming it’s just a quick and easy (lazy) way of attracting customers to their website.

What you should look into prior to this is having a look at what Google says about buying backlinks (aka; link schemes):

Buying or selling links that pass PageRank. This includes exchanging money for links, or posts that contain links; exchanging goods or services for links, or sending someone a “free” product in exchange for them writing about it and including a link.

Funnily enough, one of the first things Google mentions in its guidelines is related to link schemes and how it prohibits the buying and selling of backlinks. Exchanging money for links and generating excessive link exchanges where other sites link to others in an excessive manner is banned by Google. Should they discover that you have bought links, it WILL severely penalise your website without any given reason. Google is very clever, don’t underestimate their power.

If this does happen to you, you’ll be stuck in a pretty sticky predicament: you will be left without anywhere to go. The only thing you can do is to contact Google using their webmaster tool and hope that there will be a reply. While Google is not known for replying to such queries, consider yourself lucky if your website is restored at a later stage… very lucky indeed!

Don’t just take our word for it though, a quick Google search will tell you that most people lose their minds trying to recover from such a situation. The most practical way of recovering from this is to remove the ‘bad links’, which will ultimately restore the website a lot quicker. If you don’t have access to websites to remove such links, you should consider using Google’s Disavow Links Tool. What this does is allow publishers to tell Google that they don’t want certain links from external sites to be considered as part of Google’s system of counting links to rank web sites. It can take some time to recover, but this tool can be very useful. We spoke about Moz earlier and how they provide a spam score by a percentage. With this tool, you can actually see which links are considered spam. From this, we can include such links into our Disavow tool to regain the desired 0% spam score.

To get a general idea of how impactful search engines like Google take automated backlinks into account, they actually initiate nearly 400,000 manual actions every month. Besides the manual actions, thousands of websites are often hit by Google algorithm updates, which are specifically designed to stop low-quality websites from popping up in the search radar.

What can we take from this? Well, for any website owner, it is clear that search engines are actively monitoring low-quality backlinks and spam issues, so you always need to be very careful! Buying backlinks is an easy strategy, but is it worth the risk? Definitely not.

Here are some truths about Backlinks…

Google and other search engines DO NOT promote link building. If you’re quite new to the wonderful world of SEO, this surely might sound confusing or contradictive as backlinking is widely used to promote the SEO of your website.

Despite what Google suggests, SEO experts have proven that backlinks are a huge factor in terms of higher page rank. Over time, this fact has been proven on a variety of occasions. For this reason, if someone tells you that link building is not important, they probably don’t have a clue what they are talking about.

Nothing against Google, and if the truth were told, if I were one of Google’s executives or the owner of an emerging search engine, I would probably do the same. After all, there are reasons to continue focusing on all aspects of your website, which DO include high-quality backlinks.

What should we focus on then?

High Quality Backlinks

Backlinks are not always ‘equal’. What we mean here is that there are high-quality backlinks and low-quality. A high-quality backlink is most likely a link from an authoritative and legitimate website. However, a low-quality backlink is generally one from a low ranked website, a spam website, or a link exchange.

What we mean here is that you should not simply focus on the total number of backlinks you have, but instead, focus on the overall quality of backlinks you have. For example, we would rather have 10 quality backlinks (where the PA and DA are very high), than 200 low-quality backlinks from unreputable or spammy websites. In fact, these low-quality backlinks can actually lower your overall ranking on SERP’s.

Let’s cover: Do Follow vs. No Follow Links

What is a do follow link?

A do follow Link is a hyperlink that is able to tell all search engines to pass along its page rank influence to an outbound link.

What is a no follow link?

A no follow link is exactly the opposite of a do follow link. It is a hyperlink that removes the ability to pass on its page rank status to other sites.

Before we begin setting up a link building campaign, it’s very important to understand the difference between a follow and a no follow link.

A history of backlinks suggests that a “do follow” link is the most important type of link because it will count towards the authority of your website. On the other side, search engines will only give link juice to a “do follow” link. For this reason, if you have let’s say; 100 links that have a “do follow” attribute, search engines will count all of those 100 links towards the ranking of that particular page. However, if you have backlinks with a “no follow” attribute, it will simply ignore or give very little juice to an external website. You can read more about this from Neil Patel on his blog post: Should You Waste Time and Money on Nofollow Links? Here’s a Final Answer. When it comes to SEO, he’s the guru, we 100% recommend subscribing to his mail list, you will gather so much knowledge on SEO it’s unreal.

Anyway, the “no follow” attribute was originally introduced to reduce spam. How? Well, before lots of people were deliberately leaving links on Wiki pages, and high valued forums that quite often pointed to low-quality websites. These links did not help the web site owners because you could literally go to a lot of websites and add a backlink to your own website.

The solution to this was creating the ‘no follow’ attribute. You can read more about this here. These days, most websites such as Wikipedia, forums, and any commenting system will only allow “no follow” links that do not count as votes. As a result, it helps fight spam.

If these “no follow” links don’t count towards the ranking of a website, then what’s the point in building such links right?

While “no follow” links may not count as a vote, it can definitely get you a lot of traffic if placed on an authoritative website. With the passage of time, hundreds of these no follow links can build a regular stream of referral traffic that will continue non-stop. It means that you will not need to put any effort after placing the link because the link will bring automatic traffic to your website.

In the end, it always helps to build a mix of no follow and do follow links. Even when you’re using an SEO professional to rank your website, ask them if they know about the proportion of do follow vs. no follow links.

To conclude…

We have discovered now how search engines have evolved over time. In the olden days, we could rank for websites using a variety of keywords to gain traffic, stuff pages with thousands of keywords, and gain a load of traffic. Well, we can’t do that anymore, search engines have evolved and we now know that we can get severely penalised for using such techniques. This can go the same way with buying backlinks… If you get caught, you will get penalised, it’s as simple as that. There are cases where people have been fortunate to get away with it and even try and find loopholes around this to make it safer, we won’t mention these techniques but you have to ask yourself the question: Is it worth it?

For us, we’re pretty happy gaining backlinks from websites we build (i.e. by adding Developed by Silva Web Designs in the footer) and if anyone mentions one of our articles in their blog posts, then awesome! We tend to concentrate on several other SEO techniques as well. We won’t list them all but this includes SEO best practices, like only having one h1 tag per page, optimising all images and improving the page speed which can be checked using tools such as Google’s PageSpeed Insights or another one we like to use; GTMetrix.

There are other ways to gain traffic depending on your budget as well such as Google Ads. How this works is like an auction system: Google Ads, aka Google AdWords, is Google’s advertising system in which advertisers bid on certain keywords in order for their clickable ads to appear in Google’s search results. Since advertisers have to pay for these clicks, this is how Google makes money from search. Not only Google of course, but generating traffic to your website may also gain revenue, so if the ROI (return of investment) is worth it, it’s definitely a great tool to use.

If you have any questions in regards to this article, feel free to get in touch or leave a comment below.

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well of many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

The Impact Of Web Design On Conversion Rate In Your Company

Do you know that a good website design can positively influence your website’s conversion rate? Research conducted at Stanford shows that 75% of website visitors will judge a company’s credibility based on their website design. Also, an unattractive website will turn about 38% of new website visitors off from ever revisiting your site.

Your website design shouldn’t be just about functionality; you should also consider search engine optimisation, branding, user experience and the user interface, traffic that will be coming into the website, your sales funnel, etc.

So, if you are creating a website for your business or updating your website, we will share a few tips that can increase your conversion rate through your website design.

Your website aesthetics matter

You might not think so, but a beautifully designed website will keep every two out of three people on your site for longer. Your website aesthetic is the first contact visitors have with your website, and it will form their first impression of the kind of company you have.

This impression will then either lead them to stick with your website or close the window. So, you want to make an excellent first impression.

Figure out what you want your visitors to know about your company, and then find ways to integrate it into your website design. For example, a clean and ultra-modern website aesthetic will convey to your visitors that your business is modern.

A mobile-friendly website can boost conversion rate

Another way your website can increase your conversion is through mobile responsiveness. In 2018 alone, about 52% of all website traffic came from mobile devices. That is more than half of the internet population was viewing websites using their phones. Let that sink in.

Mobile internet is here to stay, and you need to structure your website to keep on top of this trend if you want to increase conversion. Here are a few ways you can embrace a mobile-friendly design for your website:

  • Keep your website menu simple. This will help your mobile visitors swiftly access the most useful content on your site.
  • Ensure your navigation helps mobile users quickly move from one topic to another. You can incorporate sticky navigations, ‘back to the top’ links, anchor links, etc. into your website design.
  • Reduce the amount of CTA on your mobile site. Put the most important action you want your mobile visitors to take upfront, and ensure you aren’t bombarding them with unnecessary pop-ups.

Embrace white space in your website design

Next, white space is invaluable in building a conversion web design. You need your website visitors to be able to scan your site when they first open it easily.

So, by using whitespace in your design, you can:

  • Highlight your CTA to your site visitors.
  • Bring your most valuable website features front and centre
  • Promote high conversion images on your site.
  • Highlight your cornerstone content, etc.

White space is a high conversion optimisation design technique. Whereas, a clustered website will both turn your website visitors off and prevent essential features on your website from reaching your visitors.

Call-to-action placement on your website

Also, know that there is no such thing as a high-converting website without a solid CTA. A well-designed call-to-action is essential in your conversion web design, and by ‘well-designed’ we mean that the CTA on your website must:

  • Be clear and straight to the point.
  • Contain unambiguous action-oriented language (your visitors should immediately understand the action you want them to take).
  • Be more than one. Some visitors might want to ‘buy’ some visitors might want to ‘sign up.’ Create various actions you want your visitors to take and place them evenly around your site.

pickthewriter.com/

Drafting the right CTA might take some time, but once you get it right, you will notice a growth in your conversion. However, not everyone is an expert in drafting action-driving content, so writing review websites like Pick The Writer and Writing Judge where you can hire writers can come in handy.

Readability and typography in your site design

One of the changes in web design to improve conversion rate we advise is clear and high-contrast typography. The font type, font size, font colour, etc. you use on your website can help your readers actually read your content. Which, in turn, can affect your conversion.

For example, a visitor that comes on your website looking for something, in particular, will appreciate fonts that help them skim through your site. If they can quickly identify what your offering is, they can take desired actions.

So,

  • Make sure your visitors can clearly differentiate your headlines and subheads. You can do this by using different font sizes or types in your headlines, subheadings, and paragraphs. You can also play with font colours, and textures.
  • Be consistent in your font type, size, colour, etc. all through your site.
  • Use no more than three fonts in your website design. This will help increase website usability and readability.

Content placement on your site & SEO ranking

Finally, in making changes on a web design to improve conversion rate, your site SEO and content placement go hand-in-hand. For example, in Google search ranking, websites with written content have a higher ranking than others.

Next, placing valuable content at the top of your site page can help your SEO ranking as well as help your visitors understand what your site is all about, which in turn can increase your conversion.

Although Google has improved in matching SEO synonyms to help website ranking, using literal keywords in your opening headings and paragraphs is still beneficial for your web ranking.

Also, adding useful content to your website will ensure that visitors stay longer on your site, which will benefit your website ranking.

Wrapping-up

Conversion web design is a practice that you shouldn’t neglect if you want to see a rise in your conversion rate. These few tips we have given you can help in the changes in web design to improve the conversion rate. So, don’t forget that your website can be a sales tool that actually sells, simply by following our tips.

Posted by: John Edwards

John Edwards is a writing specialist who is looking for ways of self-development in the field of writing and blogging. New horizons in his beloved business always attract with their varieties of opportunities. Therefore, it is so important for him to do the writing.

It’s good to share

How to create an Advanced AdWords Budget Script

Why use an AdWords Script to solve the problem with a budget?

So you’ve set up AdWords to gain more traffic to your website but you want to limit how much you spend on your campaigns per day/month/year, well this is exactly what we are going to show you today. We’ve heard a fair few horror stories where incorrect setup have caused businesses to pay high fees to Google AdWords simply because it wasn’t set up correctly. We are going to show you three case scenarios in which scripts can monitor exactly how much you spend and not exceed your budget.

The advanced budget script that we will be showing you today can be used to address several use cases:

1. Enforce Account Budgets

Firstly, budgets in AdWords are set at the campaign level. You can use a shared budget and assign all campaigns to it to get an account-level budget, but then you lose the ability to dedicate more money to higher performing campaigns.

We think shared budgets are useful because many advertisers don’t have time to manage things as granularly as they should. However, for those who want to get the very best results it’s better to manage the budget for each campaign separately.

So the first use case is simple, the script pauses all active campaigns when an account’s cost goes above a certain threshold for the month. You still set campaign level daily budgets but as soon as the total cost for the account gets too high, everything is paused.

2. Maintain Monthly Budgets

It could be argued that simply dividing a monthly budget evenly between all days is a fine way to turn the daily budgets AdWords uses into the monthly budgets that a typical business thinks about. But just like shared budgets are not great because you give up granularity, daily budgets that are the same every day don’t give you the control to spend money when it will lead to the best returns.

A great example of this in which we’ll use today is the month of December, since, with this particular month, we may not want to share the budget equally between every day of the month. Retailers know that the biggest opportunity for moving merchandise will come before Christmas. That being said, you might set higher daily budgets for Dec 1-24 than for Dec 25-31. That creates the risk that you could spend more than intended for the entire month. This script lets advertisers enforce a budget for a date range other than daily so that a campaign can automatically be paused when the cost starts to exceed the maximum allowed for the month, regardless of the daily budget.

The script can also be set to check budgets daily, weekly from Sunday through today, or weekly from Monday through today.

3. Apply Small Budgets To Tests

Let’s say you have a campaign that’s working really well and for which you’ve set a high budget, you might be worried that testing new ads or keywords could lead to accidentally spending a lot of money on something that performs worse than your expectations. Here’s a simple example that illustrates this issue. Let’s say you have a campaign with a £500 budget with all exact match keywords that usually produce a ROAS of about 10. Then you add a pretty generic broad match keyword and before you know it this new keyword has spent 90% of that campaign’s budget and is losing money. It stole the budget from what you knew was going to perform well and now you’re left with a loss for the day.

With this script, you can enforce small budgets down to the keyword or ad level. These experimental items can still go into your existing campaigns so you don’t need to maintain separate campaigns for testing.

The script can check budgets at the keyword, ad, ad group, campaign or account level.

The Script & Script Settings

Awesome, we’ve told you all about the script and the benefits and now you want to implement it right? Okay, great, first we are going to show you the code snippet to run on AdWords but make sure to check the script settings after the code script to ensure you have set it up correctly to your expectations!


DEBUG = 0;
 

function main() {

  Logger.log("");
  
//var SETTINGS = new Object();
  currentSetting = new Object();
  currentSetting.scope = "Account";	
  currentSetting.maxCost = getFloat("1000");
  currentSetting.budgetPeriod = "Monthly";
  currentSetting.labelName = "";
  currentSetting.labelToAdd = "stopped by budget script";
  currentSetting.email = "[email protected]";
  currentSetting.pauseItems = "yes";
  currentSetting.reEnableItems = "yes";
  
  currentSetting.logText = "";
  
  currentSetting.currencyCode = AdWordsApp.currentAccount().getCurrencyCode();
  
  switch(currentSetting.reEnableItems.toLowerCase()) {
    case "no":
      currentSetting.reEnableAtStartOfNewPeriod = 0;
      break;
    case "yes":
      currentSetting.reEnableAtStartOfNewPeriod = 1;
      break;
  }
  
  switch(currentSetting.pauseItems.toLowerCase()) {
    case "no":
      currentSetting.pauseWhenExceeds = 0;
      break;
    case "yes":
      currentSetting.pauseWhenExceeds = 1;
      break;
  }
  
  switch(currentSetting.budgetPeriod) {
	  case "Daily":
	  	//Logger.log("daily");
      currentSetting.dateRange = "TODAY";
	  	break;
	  case "Weekly Sun-Sat":
        //Logger.log("weekly sun");
        currentSetting.dateRange = "THIS_WEEK_SUN_TODAY";
	  	break;
      case "Weekly Mon-Sun":
        //Logger.log("weekly mon");
        currentSetting.dateRange = "THIS_WEEK_MON_TODAY";
	  	break;
	  case "Monthly":
        //Logger.log("monthly"); 
	  	currentSetting.dateRange = "THIS_MONTH";
        break;
  }
  
  
    
  var thenAction = "Pause"; // Alert
  var condition1 = "Cost > " + currentSetting.maxCost;
  var labelCondition = "Status = ENABLED";
  if(currentSetting.labelName) {
    labelCondition = "LabelNames CONTAINS_ANY ['" + currentSetting.labelName + "']";
  }
  if(DEBUG == 1) Logger.log("labelCondition: " + labelCondition);

  currentSetting.enabledCounter = 0;
  currentSetting.deletedCounter = 0;
  currentSetting.pausedCounter = 0;
  currentSetting.enabledList = new Array();
  currentSetting.pausedList = new Array();
  currentSetting.deletedList = new Array();
  
  
  // Set up labels
  var labelToAddText = currentSetting.labelToAdd + " (" + currentSetting.budgetPeriod + ")";
  Logger.log("labelToAddText: " + labelToAddText);
  currentSetting.labelToAdd = labelToAddText;
  if(currentSetting.labelToAdd) {
    createLabel(currentSetting.labelToAdd, "This label is used by an account automation. Its name should not be changed.");
  }
  
  
  if(currentSetting.reEnableAtStartOfNewPeriod) {
    // Check current date, day and time
    currentSetting.thisAccountTime = getTimeInThisAccount();
    var currentHour = currentSetting.thisAccountTime.HH;
    //Logger.log("currentHour: " + currentHour);
    var dayOfWeek = currentSetting.thisAccountTime.dayOfWeek;
    //Logger.log("dayOfWeek: " + dayOfWeek);
    var dd = currentSetting.thisAccountTime.dd;
    //Logger.log("dd: " + dd);
    
    //Re-activate paused items when start of a new period
    var pluralText = "";
    if(currentSetting.budgetPeriod.toLowerCase().indexOf("daily") != -1) {
      if(currentHour == 0) {
        reEnable();
        var emailType = "Notification";
        var body = 'Resetting daily budgets';
        if(currentSetting.enabledList.length > 0) {
          body += "<br/>";
          body += "Re-Enabled Because We Started a New Daily Budget Period:<br/><ul>";
          
          for(var itemCounter = 0; itemCounter < currentSetting.enabledList.length; itemCounter++) {
            var item = currentSetting.enabledList[itemCounter];
            body += "<li>" + item + "</li>";
          }
          body += "</ul>";
        }
        sendEmailNotifications(currentSetting.email, "Daily Budgets Reset", body, emailType );
        if(currentSetting.enabledList.length > 1) pluralText = "s";
        currentSetting.logText += currentSetting.enabledList.length + " " + currentSetting.scope + pluralText + " enabled. ";
      }
    } else if(currentSetting.budgetPeriod.toLowerCase().indexOf("weekly sun-mon") != -1) {
      if(dayOfWeek == 7 && currentHour == 0) {
        reEnable();
        var emailType = "Notification";
        var body = 'Resetting weekly budgets<br/>';
        if(currentSetting.enabledList.length > 0) {
          body += "<br/>";
          body += "Re-Enabled Because We Started a New Weekly Budget Period:<br/><ul>";
          
          for(var itemCounter = 0; itemCounter < currentSetting.enabledList.length; itemCounter++) {
            var item = currentSetting.enabledList[itemCounter];
            body += "<li>" + item + "</li>";;
          }
          body += "</ul>";
        }
        sendEmailNotifications(currentSetting.email, "Weekly Budgets Reset", body, emailType );
        if(currentSetting.enabledList.length > 1) pluralText = "s";
        currentSetting.logText += currentSetting.enabledList.length + " " + currentSetting.scope + pluralText + " enabled. ";
      }
    } else if(currentSetting.budgetPeriod.toLowerCase().indexOf("weekly mon-sun") != -1) {
      if(dayOfWeek == 1 && currentHour == 0) {
        reEnable();
        var emailType = "Notification";
        var body = 'Resetting weekly budgets<br/>';
        if(currentSetting.enabledList.length > 0) {
          body += "<br/>";
          body += "Re-Enabled Because We Started a New Weekly Budget Period:<br/><ul>";
          
          for(var itemCounter = 0; itemCounter < currentSetting.enabledList.length; itemCounter++) {
            var item = currentSetting.enabledList[itemCounter];
            body += "<li>" + item + "</li>";;
          }
          body += "</ul>";
        }
        sendEmailNotifications(currentSetting.email, "Weekly Budgets Reset", body, emailType );
        if(currentSetting.enabledList.length > 1) pluralText = "s";
        currentSetting.logText += currentSetting.enabledList.length + " " + currentSetting.scope + pluralText + " enabled. ";
      }
    } else if(currentSetting.budgetPeriod.toLowerCase().indexOf("monthly") != -1) {
      if(dd == 1 && currentHour == 0) {
        reEnable();
        var emailType = "Notification";
        var body = 'Resetting monthly budgets on the ' + dd + 'st of the month at ' + currentHour + "h<br/>";
        if(currentSetting.enabledList.length > 0) {
          body += "<br/>";
          body += "Re-Enabled Because We Started a New Monthly Budget Period:<br/><ul>";
          
          for(var itemCounter = 0; itemCounter < currentSetting.enabledList.length; itemCounter++) {
            var item = currentSetting.enabledList[itemCounter];
            body += "<li>" + item + "</li>";;
          }
          body += "</ul>";
        }
        sendEmailNotifications(currentSetting.email, "Monthly Budgets Reset", body, emailType );
        if(currentSetting.enabledList.length > 1) pluralText = "s";
        currentSetting.logText += currentSetting.enabledList.length + " " + currentSetting.scope + pluralText + " enabled. ";
      }
    }
  }
  
  // ------------------------------
  // CHECK IF BUDGETS HAVE EXCEEDED
  // ------------------------------
  
  // Account
  if(currentSetting.scope.toLowerCase().indexOf("account") != -1) {
    var fields = "Cost";
    var reportIterator = AdWordsApp.report('SELECT ' + fields +
      ' FROM ACCOUNT_PERFORMANCE_REPORT DURING ' + currentSetting.dateRange).rows();
    
    while(reportIterator.hasNext()) {
    var row = reportIterator.next();
    var cost = getFloat(row["Cost"]).toFixed(2);
      if(DEBUG == 1) Logger.log("Cost: " + cost + " currentSetting.maxCost: " + currentSetting.maxCost);
    }
    if(cost > currentSetting.maxCost) {
      // check if all campaigns are paused
      var campaignIterator = AdWordsApp.campaigns()
      .withCondition("Status = ENABLED")
      .get();
      
      var numActiveCampaigns = campaignIterator.totalNumEntities();
      
      if(numActiveCampaigns > 0) {
        var body = "The total cost for the account '" + AdWordsApp.currentAccount().getName() + "' (" + AdWordsApp.currentAccount().getCustomerId() + ") was " + currentSetting.currencyCode + " " + cost
                   + " as of the time of this email. The maximum allowed cost is " + currentSetting.currencyCode + " " + currentSetting.maxCost.toFixed(2) + " " + currentSetting.budgetPeriod + "." +
                     "<br/><br/>The account will continue to accrue more cost unless you take action like pausing all campaigns.";
        var emailType = "warning";
        sendEmailNotifications(currentSetting.email, "Account Budget Exceeded", body, emailType );
        //Logger.log("email sent");
        currentSetting.logText = "Account cost of " + currentSetting.currencyCode + " " + cost + " exceeds the maximum " + currentSetting.budgetPeriod + " cost of " + currentSetting.currencyCode + " " + currentSetting.maxCost.toFixed(2);
        
        if(currentSetting.pauseWhenExceeds) {
          while (campaignIterator.hasNext()) {
            var campaign = campaignIterator.next();
            var name = campaign.getName();
            campaign.pause();
            campaign.applyLabel(currentSetting.labelToAdd);
            currentSetting.pausedCounter++;
            currentSetting.pausedList.push(name);
          }
        }
      }
    } else {
      Logger.log("Account cost is currently " + currentSetting.currencyCode + cost + " and this does not exceed the allowed budget for the account.");
    }
  }
  
  // Campaigns
  else if(currentSetting.scope.toLowerCase().indexOf("campaign") != -1) {
    
    if(currentSetting.labelName != "") {
      var isLabelUsed = checkIfLabelIsUsed(currentSetting.scope, currentSetting.labelName);
    } 
    
    
    if(DEBUG == 1) Logger.log(condition1);
    if(DEBUG == 1) Logger.log(labelCondition);
    if(DEBUG == 1) Logger.log(currentSetting.dateRange);
    
    // SEARCH AND DISPLAY CAMPAIGNS
    var iterator = AdWordsApp.campaigns()
    .withCondition(condition1)
    .withCondition("Status = ENABLED")
    .withCondition(labelCondition)
    .forDateRange(currentSetting.dateRange)
    .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getName();
      var cost = item.getStatsFor(currentSetting.dateRange).getCost();
      item.applyLabel(currentSetting.labelToAdd);
      Logger.log("Match found: '" + name + "' cost: " + currentSetting.currencyCode + " " + cost);
      if(currentSetting.pauseWhenExceeds) item.pause();
      currentSetting.pausedCounter++;
      currentSetting.pausedList.push(name + " cost: " + currentSetting.currencyCode + " " + cost);
    } 
    
    
    
    if(currentSetting.pausedCounter == 0) {
      Logger.log("No campaigns exceeded their allowed budgets for the budget period.");
    } else {
      //Logger.log("something else");
    }
    
    
  } else
  
    
  // Ad Groups
  if(currentSetting.scope.toLowerCase().indexOf("ad group") != -1) {
    
    if(currentSetting.labelName != "") {
      var isLabelUsed = checkIfLabelIsUsed(currentSetting.scope, currentSetting.labelName);
    } 
    
    // SEARCH AND DISPLAY CAMPAIGNS
    var iterator = AdWordsApp.adGroups()
     .withCondition(condition1)
     .withCondition("Status = ENABLED")
     .withCondition(labelCondition)
     .forDateRange(currentSetting.dateRange)
     .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getName();
      var cost = item.getStatsFor(currentSetting.dateRange).getCost();
      var campaignName = item.getCampaign().getName();
      Logger.log("Match found: " + "campaign: '" + campaignName + "' ad group: '" + name + "' cost: " + currentSetting.currencyCode + " " + cost);
      item.applyLabel(currentSetting.labelToAdd);
      if(currentSetting.pauseWhenExceeds) item.pause();
      currentSetting.pausedCounter++;
      currentSetting.pausedList.push("campaign: '" + campaignName + "' ad group: '" + name + "'" + " cost: " + currentSetting.currencyCode + " " + cost);
    } 
    
    
    
    if(currentSetting.pausedCounter == 0) {
      Logger.log("No ad groups exceeded their allowed budgets for the budget period.");
    }
    
    
    // Ads
  } else if(currentSetting.scope.toLowerCase().indexOf("ad text") != -1) {
    
    if(currentSetting.labelName != "") {
      var isLabelUsed = checkIfLabelIsUsed(currentSetting.scope, currentSetting.labelName);
    } 
    
    var adIterator = AdWordsApp.ads()
     .withCondition(condition1)
     .withCondition("Status = ENABLED")
     .withCondition(labelCondition)
     .forDateRange(currentSetting.dateRange)
     .get();
    
    
    while(adIterator.hasNext()) {
      
      var ad = adIterator.next();
      var adHeadline = ad.getHeadline();
      var description1 = ad.getDescription1();
      var description2 = ad.getDescription2();
      var displayUrl = ad.getDisplayUrl();
      var cost = ad.getStatsFor(currentSetting.dateRange).getCost();
      ad.applyLabel(currentSetting.labelToAdd);
      
      Logger.log("Match found: " + adHeadline + " " + description1 + " " + description2 + " " + displayUrl  + " -- cost: " + currentSetting.currencyCode + " " + cost);
      var fullAdText = adHeadline + " " + description1 + " " + description2 + " " + displayUrl;
      if(currentSetting.pauseWhenExceeds) ad.pause();
      currentSetting.pausedCounter++;
      currentSetting.pausedList.push(fullAdText + " -- cost: " + currentSetting.currencyCode + " " + cost);
    } // while(adIterator.hasNext())
    
    if(currentSetting.pausedCounter == 0) {
      Logger.log("No ads exceeded their allowed budgets for the budget period.");
    }
    
    
    // Keywords
  } else if(currentSetting.scope.toLowerCase().indexOf("keyword") != -1) {
    
    if(currentSetting.labelName != "") {
      var isLabelUsed = checkIfLabelIsUsed(currentSetting.scope, currentSetting.labelName);
    } 
    
    var iterator = AdWordsApp.keywords()
     .withCondition(condition1)
     .withCondition("Status = ENABLED")
     .withCondition(labelCondition)
     .forDateRange(currentSetting.dateRange)
     .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getText();
      var cost = item.getStatsFor(currentSetting.dateRange).getCost();
      var campaignName = item.getCampaign().getName();
      var adGroupName = item.getAdGroup().getName();
      Logger.log("Match found: " + "campaign: '" + campaignName + "' ad group: '" + adGroupName + "' kw: '" + name + "' cost: " + currentSetting.currencyCode + " " + cost);
      item.applyLabel(currentSetting.labelToAdd);
      if(currentSetting.pauseWhenExceeds) item.pause();
      currentSetting.pausedList.push("campaign: '" + campaignName + "' ad group: '" + adGroupName + "' kw: '" + name + "'" + " cost: " + currentSetting.currencyCode + " " + cost);
      currentSetting.pausedCounter++;
    } // while iterator hasnext
    
    if(currentSetting.pausedCounter == 0) {
      Logger.log("No keywords exceeded their allowed budgets for the budget period.");
    }
    
    
  } // if scope == keyword
  
  
  currentSetting.pausedList.sort();
  if(currentSetting.pausedCounter > 1) {
    var pluralText = "s";
  } else {
    var pluralText = "";
  }
  var body = currentSetting.pausedCounter + " " + currentSetting.scope + pluralText + " exceeded the " + currentSetting.budgetPeriod + " maximum cost of " + currentSetting.currencyCode + " " + currentSetting.maxCost.toFixed(2) + ". ";
  if(currentSetting.pauseWhenExceeds) body += "They were paused by the script.";
  body += "<br/><ul>";
  
  if(DEBUG == 1) Logger.log("currentSetting.email: " + currentSetting.email + " currentSetting.pausedCounter: " + currentSetting.pausedCounter);
  if(currentSetting.email && currentSetting.pausedCounter > 0) {
    
    var changesMadeOrSuggestedText = "suggested";
    if(currentSetting.pauseWhenExceeds) changesMadeOrSuggestedText = "made";
    
    var pausedOrSuggestedText = "exceeded budget";
    if(currentSetting.pauseWhenExceeds) pausedOrSuggestedText = "paused";
    
    var subject = "Automated Rules for " + AdWordsApp.currentAccount().getName() + ": " + currentSetting.pausedCounter + " change" + pluralText + " " + changesMadeOrSuggestedText;
    currentSetting.logText += currentSetting.pausedCounter + " " + currentSetting.scope + pluralText + " " + pausedOrSuggestedText;
    for(var itemCounter = 0; itemCounter < currentSetting.pausedList.length; itemCounter++) {
      var item = currentSetting.pausedList[itemCounter];
      body += "<li>" + item + "</li>";
    }
    body += "</ul><br/>";
    body += "These items were labeled '" + currentSetting.labelToAdd + "' for easy identification.<br/><br/>";
    body += "Thanks for using a free Optmyzr.com script. Try our Enhanced Scripts for AdWords which have several benefits:<ul><li>automatically updated when AdWords changes</li><li>works with MCC or individual accounts</li><li>change settings without touching a single line of code</li></ul>";
    body += "Get a 2 week free trial at <a href='https://www.optmyzr.com?utm_campaign=free_scripts'>optmyzr.com</a>";
    
    
    var emailType = "notification";
    if(DEBUG == 1) Logger.log("sending email...");
    sendEmailNotifications(currentSetting.email, subject, body, emailType )
  }
}

  

  
  function reEnable(){
  // Campaigns or Account
  if(currentSetting.scope.toLowerCase().indexOf("campaign") != -1 || currentSetting.scope.toLowerCase().indexOf("account") != -1) {
    var iterator = AdWordsApp.campaigns()
     .withCondition("LabelNames CONTAINS_ANY ['" + currentSetting.labelToAdd + "']")
     .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getName();
      item.removeLabel(currentSetting.labelToAdd)
      Logger.log("Enabling campaign: " + name);
      item.enable();
      currentSetting.enabledCounter++;
      currentSetting.enabledList.push(name); 
    } 
    
    // SHOPPING CAMPAIGNS
    var iterator = AdWordsApp.shoppingCampaigns()
     .withCondition("LabelNames CONTAINS_ANY ['" + currentSetting.labelToAdd + "']")
     .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getName();
      item.removeLabel(currentSetting.labelToAdd)
      Logger.log("Enabling campaign: " + name);
      item.enable();
      currentSetting.enabledCounter++;
      currentSetting.enabledList.push(name); 
    } 
    
  } else
  
    
  // Ad Groups
  if(currentSetting.scope.toLowerCase().indexOf("ad group") != -1) {

    var iterator = AdWordsApp.adGroups()
    .withCondition("LabelNames CONTAINS_ANY ['" + currentSetting.labelToAdd + "']")
    .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getName();
      var campaignName = item.getCampaign().getName();
      Logger.log("Enabling campaign: '" + campaignName + "' ad group: '" + name + "'");
      item.removeLabel(currentSetting.labelToAdd);
      
      item.enable();
      currentSetting.enabledCounter++;
      currentSetting.enabledList.push("campaign: '" + campaignName + "' ad group: '" + name + "'");
    }
    
    // SHOPPING AD GROUPS
    var iterator = AdWordsApp.shoppingAdGroups()
    .withCondition("LabelNames CONTAINS_ANY ['" + currentSetting.labelToAdd + "']")
    .get();
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getName();
      var campaignName = item.getCampaign().getName();
      Logger.log("Enabling campaign: '" + campaignName + "' ad group: '" + name + "'");
      item.removeLabel(currentSetting.labelToAdd);
      
      item.enable();
      currentSetting.enabledCounter++;
      currentSetting.enabledList.push("campaign: '" + campaignName + "' ad group: '" + name + "'");
    }
    
    
    
    
    // Ads
  } else if(currentSetting.scope.toLowerCase().indexOf("ad text") != -1) {
    
    var adIterator = AdWordsApp.ads()
    .withCondition("LabelNames CONTAINS_ANY ['" + currentSetting.labelToAdd + "']")
    .get();
    
    
    while(adIterator.hasNext()) {
      
      var ad = adIterator.next();
      var adHeadline = ad.getHeadline();
      var description1 = ad.getDescription1();
      var description2 = ad.getDescription2();
      var displayUrl = ad.getDisplayUrl();
      ad.removeLabel(currentSetting.labelToAdd);
      
      Logger.log("Enabling ad: " + adHeadline + " " + description1 + " " + description2 + " " + displayUrl);
      var fullAdText = adHeadline + " " + description1 + " " + description2 + " " + displayUrl;
      
      
      ad.enable();
      currentSetting.enabledCounter++;
      currentSetting.enabledList.push(fullAdText);
      
    } // while(adIterator.hasNext())
    
    
    
    // Keywords
  } else if(currentSetting.scope.toLowerCase().indexOf("keyword") != -1) {
    
    var iterator = AdWordsApp.keywords()
    .withCondition("LabelNames CONTAINS_ANY ['" + currentSetting.labelToAdd + "']")
    .get();
     
    
    while(iterator.hasNext()){
      var item = iterator.next();
      var name = item.getText();
      var campaignName = item.getCampaign().getName();
      var adGroupName = item.getAdGroup().getName();
      Logger.log("Enabling campaign: '" + campaignName + "' ad group: '" + adGroupName + "' kw: '" + name + "'");
      item.removeLabel(currentSetting.labelToAdd);
      
      
      item.enable();
      currentSetting.enabledCounter++;
      currentSetting.enabledList.push("campaign: '" + campaignName + "' ad group: '" + adGroupName + "' kw: '" + name + "'");
      
    } // while iterator hasnext
  } // if scope == keyword
}

/* getTimeInThisAccount
// ----------------------
// Deals with getting the current time and date in this account
// using the timezone settings of the account.

// returns all values in currentSetting.thisAccountTime object
*/
function getTimeInThisAccount() {
  var weekday = new Array(7);
  weekday[0]=  "Sunday";
  weekday[1] = "Monday";
  weekday[2] = "Tuesday";
  weekday[3] = "Wednesday";
  weekday[4] = "Thursday";
  weekday[5] = "Friday";
  weekday[6] = "Saturday";
  
  var timeZone = AdWordsApp.currentAccount().getTimeZone();
  //Logger.log("time zone: " + timeZone);
  var date = new Date();
  
  var thisAccountTime = new Object();
  thisAccountTime.dayOfWeek = parseInt(Utilities.formatDate(date, timeZone, "uu"));
  thisAccountTime.dd =parseInt(Utilities.formatDate(date, timeZone, "dd"));
  thisAccountTime.weekday = weekday[thisAccountTime.dayOfWeek];
  thisAccountTime.HH = parseInt(Utilities.formatDate(date, timeZone, "HH"));
  thisAccountTime.timeZone = timeZone;
  
  
  return(thisAccountTime);
}

/* createLabel(name, description, backgroundColor)
// ------------
// Makes sure the label doesn't already exists before creating it
// 
*/
function createLabel(name, description, backgroundColor) {
    
    var labelIterator = AdWordsApp.labels()
     .withCondition("Name CONTAINS '" + name + "'")
     .get();
    
    if(labelIterator.hasNext()) {
      Logger.log("Label already exists");
    } else {
      Logger.log("Label needs to be created: " + name + " desc: " + description + " color: " + backgroundColor);
      if(description && backgroundColor) {
        AdWordsApp.createLabel(name, description, backgroundColor);
        Logger.log("Label created");
      } else if (description) {
        AdWordsApp.createLabel(name, description);
        Logger.log("Label created");
      } else {
        AdWordsApp.createLabel(name);
        Logger.log("Label created");
      }
    }
  }	  
  /* checkIfLabelIsUsed(scope, labelName)
// --------------------------------------
// Check is a label that will be used to search for entities is actually used by at
// least 1 of those entities.
//
// This prevents weird cases where the script fails without error due to a missing label
// 
*/
  function checkIfLabelIsUsed(scope, labelName) {
    var entitiesWithLabel = 0;
    var labelIterator = AdWordsApp.labels()
    .withCondition('Name = "' + labelName + '"')
    .get();
    if (labelIterator.hasNext()) {
      var label = labelIterator.next();
      if(scope.toLowerCase().indexOf("campaign") != -1) entitiesWithLabel = label.campaigns().get().totalNumEntities();
      if(scope.toLowerCase().indexOf("ad group") != -1) entitiesWithLabel = label.adGroups().get().totalNumEntities();
      if(scope.toLowerCase().indexOf("ad text") != -1) entitiesWithLabel = label.ads().get().totalNumEntities();
      if(scope.toLowerCase().indexOf("keyword") != -1) entitiesWithLabel = label.keywords().get().totalNumEntities();
      return(entitiesWithLabel);
    }
    
    if(!entitiesWithLabel) {
      Logger.log("No campaigns use the label '" + currentSetting.labelName + "' so this script won't do anything. Update your settings on optmyzr.com with the name of a label that is used for at least 1 campaign.");
    } 
  }
  
  /*
  // emailType can be: notification or warning
  */
  function sendEmailNotifications(emailAddresses, subject, body, emailType ) {
	
    if(emailType.toLowerCase().indexOf("warning") != -1) {
      var finalSubject = "[Warning] " + subject + " - " + AdWordsApp.currentAccount().getName() + " (" + AdWordsApp.currentAccount().getCustomerId() + ")"
    } else if(emailType.toLowerCase().indexOf("notification") != -1) {
      var finalSubject = "[Notification] " + subject + " - " + AdWordsApp.currentAccount().getName() + " (" + AdWordsApp.currentAccount().getCustomerId() + ")"
    }
    
    if(AdWordsApp.getExecutionInfo().isPreview()) {
      var finalBody = "<b>This script ran in preview mode. No changes were made to your account.</b><br/>" + body;
    } else {
      var finalBody = body;
    }
    
	MailApp.sendEmail({
        to:emailAddresses, 
        subject:  finalSubject,
        htmlBody: finalBody
      });
    
    if(DEBUG == 1) Logger.log("email sent to " + emailAddresses + ": " + finalSubject);

  }
  
  function getFloat (input) {
    if(!input || input == "" || typeof(input) === 'undefined') var input = "0.0";
    input = input.toString();
    var output = parseFloat(input.replace(/,/g, ""));
    return output;
  }

Wooooah, that’s a crazy long script, right? Fortunately there are only a few parameters at the top in which you have to tailor to your specific needs.

Okay, so first things first, install the above code to an individual AdWords account (NOT an MCC account).

Here are the lines you’ll need to update in the script to make it work:


<strong>currentSetting.scope = "Account";</strong>

Enter a value of either: Account, Campaign, Ad Group, Keyword, or Ad
This is the level at which the maximum budget will be enforced.


<strong>currentSetting.maxCost = parseFloat("1");</strong>

Enter a decimal value that represents the maximum cost each item is allowed to have.


currentSetting.budgetPeriod = "Daily";

Enter a value of either: Daily, Monthly, Weekly Sun-Sat, Weekly Mon-Sun
This is the time frame for the budget, i.e. the period during which the maximum cost can be accrued.


currentSetting.labelName = "Label name to check";

Enter the name of the label that you’ve added to the items you want the script to check. If you want to check all items of your selected scope (e.g. all keywords), then leave this blank.


currentSetting.labelToAdd = "stopped by budget script";

Enter the name of the label you want the script to add to all items that exceed the allowed budget. This will make it easy for you to find these items in an account, and it is also needed for the script to know what should be re-enabled at the start of a new period.


currentSetting.email = "[email protected]";

Enter the email address of the person to notify whenever a budget has been exceeded or whenever the script makes any changes to the account.


currentSetting.pauseItems = "yes";

Enter a value of either: yes, no
This says if the script should pause items that exceeded the budget (yes) or not (no).


currentSetting.reEnableItems = "yes";

Enter a value of either: yes, no
This says if the script should re-enable any items that were paused by the script when a new budget period commences. The script must be set to run hourly for this to work.

Conculusion

This is a fairly simple script, to be honest, but hopefully, it will help you overcome some of the issues related to how AdWords treats budgets. We recently started using Google AdWords and have used the above script to combat our daily/monthly and yearly budgets in which we spent on Google AdWords, we’ve tested it for quite a while now and it seems pretty solid!

As always, we love to help others… and we hope this helps you too!

Let us know in the comments if this has helped you… If you have any pointers for further improvements… awesome! let us know and we’ll update this blog post to help future users.

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well of many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

How to Boost your Social Media Using WordPress

If you’re in charge of your company’s social media presence, you already know engagement is hard to achieve – not only when you have just a few followers. Even if your fan base is already quite large, it’s hard to keep track of all the metrics that can help you make decisions. Those decisions can range from content, to what types of media you should use, or even on which networks you should be active. There are plenty of articles justifying why you should use each network, but, in the end, it all boils down to your target audience and their interests – and only you know that. Or maybe you don’t. However, even if you have issues trying to pinpoint to whom exactly you should try to sell your product, using the right tools can go a long way.

This is why we wrote this article about a few tools you can integrate on WordPress which will help you make the right decisions regarding your social media presence. A few of these tools have been around for a long time, but they have stood the test of time and, using them through WordPress, you’ll have a much more holistic view of what works and what doesn’t when it comes to your social media efforts.

So, let’s go!

1. Sprout Social

Sprout Social will really suit you if you need cross-channel analysis for all your social networks: Facebook pages, Instagram, Twitter, Pinterest… the list goes on and on. You can also get detailed insights for each network you’re using, which is useful as well. It all depends on what you want to track and why. Sprout Social also has reporting features that can give you actionable insights into what you should be doing on each network you’re on to be successful. Sprout Social has been around for quite a while, so you’ll see it will help you a lot with your social media strategy. It provides you with target audience demographics, industry influencers, campaign performances, voice sharing, and analyzing consumer sentiments, among other useful metrics. Plus, its reports are easy to read and understand, which means that you don’t have to be a data guru to figure out what should be your next steps.

2. Hootsuite

If you’re a Social Media Manager, you’ve probably used Hootsuite at some point. Most people go for it because of its amazing scheduling features, which allow you to connect all your social media accounts under one app so you can post on each one of them without having to sign in constantly. Although most social media networks have scheduling features, it’s still much easier to do it from Hootsuite. On Hootsuite, you can just log in to your account and have a comprehensive view of all your social media networks at once. You can also use it to get your feeds from all social media, answer messages and mentions, and much more. On another note, it also has a free version if you’re not going to need to connect to many accounts. If you need more than what the free version offers, you can get a Professional account starting at $25 per month.

3. Buffer

Buffer has grown quite a lot ever since its inception. In the beginning, it didn’t give you much control – you’d just feed it with content and it would automatically deliver your posts. These days, it has Buffer Publish, which is pretty self-explanatory – much like Hootsuite, it allows you to schedule posts across your several social media accounts. However, it also has Buffer Reply and Buffer Analyze. Buffer Reply helps you get in touch with the people who engage with your content. Buffer Analyze is an Analytics tool that provides you with insights about which of your posts get a better engagement, which media most resonates with your audience, and much more. Plus, its free version has plenty of useful features, allowing you to add up to three social media accounts and schedule up to ten posts at once.

4. Awario

This tool hasn’t been around for so long as our first three choices, but it is quite useful to analyze your brand scalability and value. It researches mentions and reviews about your brand automatically, so it’ll deliver interesting insights about how you can not only make your social media better but also your product. This tool can go through thirteen billion pages every day, which is quite impressive. It also helps you find useful backlinks, providing you with themes for guest posting and content. Another useful feature of Awario is its social media influencer finder, which allows you to figure out which people are best to talk to about your product and who are the most reputable writers and influencers in your niche.

5. Buzzsumo

Buzzsumo is quite different from the other tools we mentioned so far, in that it mostly figures out which are the most popular posts across a large number of social networks, such as Facebook, Twitter, Instagram, and Reddit, just to mention a few. The fact it searches Reddit as well is quite a good indicator since Reddit is an aggregator that has information about all possible niches you could think about. It provides you with highly customizable search parameters and filters, allowing you to focus only on what matters for your brand. It also helps with influencer info and social backlink data, which are very actionable insights for your social media strategy.

6. Google Analytics

Even though Google Analytics is not a social media tool per se, its features include settings that allow you to track your social media campaigns and get to know which social media networks are bringing more users to your WordPress website. Using it, you can also find out which social networks provide you with the biggest ROI. It allows you to use UTM parameters to track and measure which networks and social campaigns are getting you more traffic into your website. It also offers a comprehensive report feature which can be used to track social media info such as how many people who subscribed to your newsletter came from your Twitter account.

7. Brand24

This is a tool for companies who are really invested in getting that Social Media ROI. First of all, it has no free version, but its pricing plans are reasonable and its tools are completely worth your money. Brand24 has been around for ages and it keeps on improving. It has a social search feature that automatically looks up your most important keywords and helps you stay ahead of the competition with Custom Alerts that have plenty of possible customizations. If you want to get serious about Social Media, Brand24 is a must-have for your company. It measures an enormous number of metrics including social media reach, engagement, sentiment analysis, the volume of mentions, and so on. Other key features of Brand24 include influence, trending hashtags, and many other KPIs you can measure.

Conclusion

This article’s goal is not to help you pick one tool that will help you figure out which way your social media efforts should go. Actually, our recommendation is to try all of these tools that seem right for you and go from there. Even with the paid tools like Brand24, you can get a free trial to experiment and understand what works for you. With this article, we’re simply aiming at helping you get the most out of social media by using analytics and figuring out which KPIs work best for you. For some brands, Twitter retweets are all that matters; for others, LinkedIn engagement is where it’s at. You also need to understand at which times of the day, and during which days, should you post. There is not a cookie-cutter approach for social media engagement and ROI; each brand has the right combination of tools and KPIs that work and you only get there through trial and error. However, the tools we mentioned above should give you the insights you need to make the right decision. What are your thoughts? Let us know!

Vanessa M - Profile

Posted by: Vanessa M

Vanessa Marcos is a writer and social media manager whose passion is copywriting and getting words together to create new stuff. #creativewriting #copywriting Love her writing? Find out more at Calma Copywriting.

It’s good to share