Ads 468x60px

Shoemoney - Skills To Pay The Bills

Shoemoney - Skills To Pay The Bills

Link to ShoeMoney

Ensure You Never Send Paid Traffic To a 404 Page or Broken Link

Posted: 18 Jun 2014 06:30 AM PDT

Post image for Ensure You Never Send Paid Traffic To a 404 Page or Broken Link

Paying for traffic is expensive.

There is nothing worse than sending traffic to a broken link or page that is down.

Google-Chrome-404-friendly-error-pageYou would think this would be common sense, but at least once a month I click on a ppc ad that goes to a 404 page or a page with some other error code.

It happens to the best of us. We make a change to the website and forget to update the SEM campaign, or perhaps we typed in the wrong URL in the ad, or did some bulk editing and accidentally made a mistake.

When this happens, you are throwing money down the drain, literally!

This is most common with landing pages where you might make changes constantly, or launch new campaigns and take down old ones or simply redesign your site. There are lots of reasons why a landing page might not resolve…but, there is NO EXCUSE to be paying for clicks that you have no chance of converting. 

Hint: It is a good idea to turn your 404 page into a landing page. LeadPages.net offers a great 404 template in an easy to deploy format for WordPress sites.

If you are running traffic to dozens or hundreds of pages, it's hard to know if one goes down.

Here's a strategy you can follow to monitor your ppc for broken links to make sure your landing pages are always up and running.

There are two versions of this Adwords Script, one which monitors one account and another meant for MCC accounts where you can monitor multiple accounts simultaneously.

As you know, Adwords Scripts programmatically make changes to your Adwords account. While this script works wonders, it only checks your Adwords landing pages. If you happen to be using the same landing pages for Bing and Yahoo,  you’re covered…

I have my script running daily, and it basically checks all the URLs in active campaigns and emails me a report of all the accounts I run. Here is a screenshot of what my reports look like:

If you were to click through to see details, it would show you exactly where the problem links are so you can quickly go in and fix them ASAP.

If you want me to monitor your account for broken links for you, simply email me your Customer ID and once it’s linked in my MCC account, this script will automatically run it for you. You can email me at david@davidmelamed.com.

If you are more of a DIY kinda guy, here are step by step instructions:

Let's dive right in. If you need to know how to setup an Adwords script follow the instructions in this post. There are only two small differences. One, you need to upload a different code for the script which will appear below and two, you will need to slightly modify this code to email you the report.

Great, now let's setup the code to install. There are two options here. Google has a code they created and shared. You can try to implement it, however when I tried it, I got an error message, so I'm not sure how to fix it, but feel free to give it a try…

Good news if it doesn’t work for you though: Russ Savage published a code that works wonders. It installed super quick, and runs like a charm.

/****************************
* Find Broken Urls In Your Account
* Version 1.1
* ChangeLog v1.1
*  - Updated to only see Text Ads
* Created By: Russ Savage
* FreeAdWordsScripts.com
****************************/
functionmain() {
  // You can add more if you want: http://goo.gl/VhIX
  varBAD_CODES= [404,500];
  varTO= ['email@example.com'/*,'email_address_2@example.com'*/];
  varSUBJECT= 'Broken Url Report - '+ _getDateString();
  varHTTP_OPTIONS= {
    muteHttpExceptions:true
  };
   
  //Let's look at ads and keywords for urls
  variters = [
    //For Ad Level Urls
    AdWordsApp.ads()
      .withCondition("Status = 'ENABLED'")
      .withCondition("AdGroupStatus = 'ENABLED'")
      .withCondition("CampaignStatus = 'ENABLED'")
      .withCondition("Type = 'TEXT_AD'")
      .get(),
    //For Keyword Level Urls
    AdWordsApp.keywords()
      .withCondition("Status = 'ENABLED'")
      .withCondition("DestinationUrl != ''")
      .withCondition("AdGroupStatus = 'ENABLED'")
      .withCondition("CampaignStatus = 'ENABLED'")
      .get()
    ];
  
  varalready_checked = {};
  varbad_entities = [];
  for(varx initers) {
    variter = iters[x];
    while(iter.hasNext()) {
      varentity = iter.next();
      if(entity.getDestinationUrl() == null) { continue; }
      varurl = entity.getDestinationUrl();
      if(url.indexOf('{') >= 0) {
        //Let's remove the value track parameters
        url = url.replace(/\{[0-9a-zA-Z]+\}/g,'');
      }
      if(already_checked[url]) { continue; }
      varresponse_code;
      try{
        Logger.log("Testing url: "+url);
        response_code = UrlFetchApp.fetch(url, HTTP_OPTIONS).getResponseCode();
      } catch(e) {
        //Something is wrong here, we should know about it.
        bad_entities.push({e : entity, code : -1});
      }
      if(BAD_CODES.indexOf(response_code) >= 0) {
        //This entity has an issue.  Save it for later.
        bad_entities.push({e : entity, code : response_code});
      }
      already_checked[url] = true;
    }
  }
  varcolumn_names = ['Type','CampaignName','AdGroupName','Id','Headline/KeywordText','ResponseCode','DestUrl'];
  varattachment = column_names.join(",")+"\n";
  for(vari inbad_entities) {
    attachment += _formatResults(bad_entities[i],",");
  }
  if(bad_entities.length > 0) {
    varoptions = { attachments: [Utilities.newBlob(attachment, 'text/csv', 'bad_urls_'+_getDateString()+'.csv')] };
    varemail_body = "There are "+ bad_entities.length + " urls that are broken. See attachment for details.";
     
    for(vari inTO) {
      MailApp.sendEmail(TO[i], SUBJECT, email_body, options);
    }
  
}
 
//Formats a row of results separated by SEP
function_formatResults(entity,SEP) {
  vare = entity.e;
  if(typeof(e['getHeadline']) != "undefined") {
    //this is an ad entity
    return["Ad",
            e.getCampaign().getName(),
            e.getAdGroup().getName(),
            e.getId(),
            e.getHeadline(),
            entity.code,
            e.getDestinationUrl()
           ].join(SEP)+"\n";
  } else{
    // and this is a keyword
    return["Keyword",
            e.getCampaign().getName(),
            e.getAdGroup().getName(),
            e.getId(),
            e.getText(),
            entity.code,
            e.getDestinationUrl()
           ].join(SEP)+"\n";
  }
}
 
//Helper function to format todays date
function_getDateString() {
  returnUtilities.formatDate((newDate()), AdWordsApp.currentAccount().getTimeZone(), "yyyy-MM-dd");
}
————————————
Simply copy and paste that code into the scripting section in Adwords, authorize the script, set the scheduling to run daily, and you are all set to go.
Just make sure you change the email address in this script 'email@example.com' to your actual email address and/or anyone else you want to email.
If you are running an MCC account, the setup process is slightly different and you may need to setup a copy of a google spreadsheet. Here are Russ Savage’s instructions for MCC accounts.

Trying to increase your Google rank that is like no other?

0 comments:

Post a Comment