Responsive Ad Shortcodes 1.0

Responsive Ad Shortcodes is a WordPress plugin that was built to scratch an itch. For some time, we’ve been trying to get AdSense and DoubleClick to play nice with responsive websites. Not easy, as the responsive ad offerings from Google fall very short and offer little control. This plugin aims to address this, allowing users to control ad display on 3 types of screen (small, medium & large). And blend ads from AdSense and DoubleClick into single units.

Because of the focus on control and flexibility this plugin uses VERY verbose shortcodes. It is not designed for newbies. If you want a simple AdSdene short code manage, take a look at WP Simple AdSense Insertion.

Core Concept

This plugin assumes you are working with a responsive site model along the lines of Bootstrap, which is what most people seem to use these days. This means that the defining metric which decides which ad to use is width. This plugin calculates the width of the parent element and decides which of your ads (small, medium & large) to place. It’s important that you order the sizes appropriately starting with largest width.

Responsive Web Design by Ethan Marcotte

Example Shortcode

[ras aligns="center|center|center" slots="5940543366|5940543366|5940543366" formats="horizontal|horizontal|horizontal" sizes="970x90x1|728x90x1|320x50x1" adtext="1|1|1"]

Arguments

aligns
Values can be left, right or center. There should be 3 values seperated by |. The first value is the alignment for the large ad placement, the second for the medium and third for the small ad placement.
slots
Values should refer to an AdSense or DoubleClick ad slot IDs. There should be 3 values seperated by |. The first value is the slot ID for the large ad placement, the second for the medium and third for the small ad placement.
formats
Values can be horizontal, vertical or rectangle. There should be 3 values seperated a |. The first value is the ad format for the large ad placement, the second for the medium and third for the small ad placement.
sizes
Values need to be structured strings of 3 sets of numbers seperated by x. The first number is the width, the second the height and the third is a boolean to turn ad display on or off. There should be 3 values seperated by |. The first value is the ad format for the large ad placement, the second for the medium and third for the small ad placement.
adtext
Values can be 1 or 0. There should be 3 values seperated by |. The first value turns of the advertisment label for the large ad placement, the second for the medium and third for the small ad placement.

That’s it! If you need help, use the WordPress support forum for this plugin.

Re-brand and maintain SEO and link juice!?!

The time has come to re-brand this site!

As a company we are doing more development, WordPress and social network work these days, and whilst we still do a lot of marketing with AdWords, we need a new website that works better for us.

So, we’ve bought a new domain name: necessarymaterials.com, but how do we re-brand and keep all the nice link juice and SEO flowing? We need to maintain all of the Sky Rocket posts and traffic under this new brand and domain name.

If anyone has any tips or tutorials for this, please let me know in the comments…

Scrape data from AdWords with Ruby Mechanize

Why would you want to scrape data from AdWords when Google provide an API and email reports? Well, managing a number of different AdWords accounts for various clients can be challenging. It can be very time consuming logging into individual accounts and checking stats on a daily basis. The AdWords API is good, but not always suitable for certain client accounts. Email reports are nice, but you still have to collate the emails from your inbox. Often the best way to download specific stats into one file is to build a web page scraper. Using a scrape script provides you with a lot more flexibility, and allows you to focus on exactly the sort of information you think is important.

Recently, we discovered a neat little Ruby library called Mechanize. Mechanize does an excellent job of navigating forms, pages and links and extracting data.

Here is an example AdWords spend scrape script to get you started…

require 'rubygems'
require 'mechanize'

adwords_accounts = [ 
	["adwords1@skyrocketonlinemarketing.com", "password"]
]

total_accounts = adwords_accounts.length

(0..total_accounts-1).each do |i|
	puts "#{adwords_accounts[i][0]}"
	agent = Mechanize.new
	agent.get("https://adwords.google.com")
	puts "#{adwords_accounts[i][0]}: #{agent.page.title}"
	sign_in_form = agent.page.forms[1]
	sign_in_form.Email = adwords_accounts[i][0]
	sign_in_form.Passwd = adwords_accounts[i][1]
	page = agent.submit(sign_in_form, sign_in_form.buttons.first)
	puts "#{adwords_accounts[i][0]}: #{agent.page.title.gsub(/n/,' ')}"
	agent.get("https://adwords.google.com/select/snapshot")	
	puts "#{adwords_accounts[i][0]}: #{agent.page.title.gsub(/n/,' ')}"
	if agent.page.title == "Redirecting"
		agent.get("https://adwords.google.com/select/snapshot")
		puts "#{adwords_accounts[i][0]}: #{agent.page.title.gsub(/n/,' ')}"
	end
	stats_title = agent.page.at(".stats-title").text
	stats_clicks = agent.page.at("tr:nth-child(1) .stats-data").text
	stats_imps = agent.page.at("tr:nth-child(2) .stats-data").text
	stats_cost = agent.page.at("tr:nth-child(6) .stats-data").text
	puts "#{adwords_accounts[i][0]}: #{stats_title} #{stats_imps} #{stats_clicks} #{stats_cost}"
	puts "n"
end

To get this to work, all you need to do is enter your account information on line 5. If you then want to use this for more accounts, simply add them to the adwords_accounts array.