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.
Tagged as:
adwords,
mechanize,
nokogiri,
ruby
Sponsored links:
Was just sent another 20 FREE AdWords coupons by Google.
- Y2BJ-V43E-NG65-8VAY-WDW
- Y2BJ-UYZA-EWL2-2C6T-3KN
- Y2BJ-UWV8-FVWJ-F39Z-QRW
- 522Y-HHFN-TR9C-9GBT-BP6
- Y2BJ-UR37-P4BU-QKW3-QRN
- Y2BJ-UNEW-CSUY-DYPY-6YW
- 522Y-HGL9-H3EW-8KKR-D3W
- Y2BJ-UHC2-WEVP-LZJR-5KW
- 522Y-HG27-39F3-4RXP-LMN
- Y2BJ-UBRA-FXP3-6MC7-MDW
- Y2BJ-U8W8-KFHG-KDZM-MQE
- 522Y-HFCE-CKRP-7QFG-A3W
- Y2BJ-U3D7-5DPK-73C2-VSE
- Y2BJ-TYRX-FHSY-N6AS-H8E
- Y2BJ-TVWG-AE66-JLT7-L8W
- Y2BJ-TTBP-9J2U-MQKG-R66
- Y2BJ-TQYE-NSQF-MPA7-9W6
- 522Y-HDT3-95ZQ-A78A-TL6
- Y2BJ-TKJ6-CLKY-KKUQ-YQN
- Y2BJ-TG7Z-CTQB-K9LB-EE6
Tagged as:
adwords,
adwords coupons,
adwords vouchers
Sponsored links:
Your potential customers decide to visit your website based solely on what they see in your ads when they type in a search query, so ad texts play a crucial role in determining the success of your AdWords advertising.
In the video below we share with you our best practices for creating winning ad texts. These will provide you with ideas to test when writing your ads, which will help to differentiate your business from the crowd and drive even more relevant traffic to your website!
via Google – Better ad texts, better performance.
Tagged as:
adwords,
ppc
Sponsored links:
Ad scheduling can help you better target your ads by selecting the times when you want to show ads. For example, if you offer special late night deals, you can set up an ad group to show those ads only between 10pm and 3am. You can also set different bids for different hours, so if you have better conversion rates during certain hours, you can set your bids higher to try and get more impressions and clicks during that time.
Source (Inside AdWords)
Tagged as:
adwords
Sponsored links:
We love web apps, and as we’ve said before, we use a lot of them. The only problem with web apps is keeping them all open in 1 browser. Fluid App can help with this…
Are you a Gmail, Facebook, Campfire or Pandora fanatic? Do you have 20 or more browser tabs open at all times? Are you tired of some random site or Flash ad crashing your browser and causing you to lose your (say) Google Docs data in another tab?
If so, Site Specific Browsers (SSBs) provide a great solution for your WebApp woes. Using Fluid, you can create SSBs to run each of your favorite WebApps as a separate Cocoa desktop application. Fluid gives any WebApp a home on your Mac OS X desktop complete with Dock icon, standard menu bar, logical separation from your other web browsing activity, and many, many other goodies.
Source: Fluid.
Tagged as:
adwords,
basecamp,
highrise,
netinsight,
wordpress
Sponsored links: