1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Tip] Get All of Your Data out of Web Master Tools

Discussion in 'White Hat SEO' started by Endire, Jul 16, 2013.

  1. Endire

    Endire Elite Member Premium Member

    Joined:
    Mar 27, 2012
    Messages:
    1,756
    Likes Received:
    1,061
    Gender:
    Male
    I found this tutorial online on how to get your data out of WMT. This includes all external linking domains, social interactions, internal links, content keywords, crawl errors, content errors and top pages and queries.
    Note that requirements are you must be running a local server (for this I used XAMPP) and you must have a website registered in Google Web Master Tools.

    You can download XAMPP here and set it up http://www.apachefriends.org/en/xampp.html. It?s a fat file so it will take a minute to download. If you haven?t used it before, I recommend the installer download which relies on Windows installer to do the setup sequence for you.

    Test to see if it is working by visiting localhost/xampp. You should see the xampp logo. If you don?t see that, you may have the error below.

    Once you have it set up, you must enable the services that it comes with. For this process enable Apache and that is all you will need.
    You might receive an error letting you know that a port Apache needs to run is being used by another service. This is most likely World Wide Web Publishing Service. You can disable this by typing services.msc from the run command prompt > scroll down to World Wide Publishing service, right click on it and select stop. Then try starting apache again.

    If you installed xampp into your C:/ drive (which it will do be default), go to C:/xampp/htdocs and create a folder for your downloaded CSV files to go into. You can name it whatever you want. I called mine web-master-tools-data.
    Next download this php file and save it to the folder you just created in the htdocs directory.
    http://php-webmaster-tools-downloads.googlecode.com/files/gwtdata.v2.php

    Remove the v2 from the file or it won?t work. That file will be included using the script below and it is not written that way in the script.
    Create another php file (you can use notepad++ to do this) and call it whatever you want (I called mine gwt.php). Paste this code in it.

    Code:
    <?php
            include 'gwtdata.php';
            try {
                    $email = "username@gmail.com";
                    $password = "******";
                    # If hardcoded, don't forget trailing slash!
                    $website = "http://www.domain.com/";
                   
                    $gdata = new GWTdata();
                    if($gdata->LogIn($email, $password) === true)
                    {                       
                            $gdata->DownloadCSV($website);                 
                    }
            } catch (Exception $e) {
                    die($e->getMessage());
            }
    ?>
    Note that you have to replace the email with your email and password with your google password that your webmaster tools account is associated with and replace domain.com with the domain for which data is being downloaded.

    Now you will run the script by typing http://localhost/whatever-you-calle...n-htdocs/whatever-you-named-your-php-file.php

    After the page loads you could see some errors. One of the most common ones that I encountered was this one,

    Notice: Undefined offset: 0 in C:\xampp\htdocs\my-programs\gwtdata.php on line 384

    On line 384 of gwtdata.php, the code has a bug and reads as follows,

    Code:
    preg_match_all("#x26security_token(.*?)$delimiter#si", $tmp, $matches);
    return substr($matches[1][0],4,-1);
    Change it to this and you should be good to go,

    Code:
    preg_match_all("#46security_token(.*?)$delimiter#si", $tmp, $matches);
                                                                return substr($matches[1][0],3,-1);
    Note that even if you receive the error, check your new folder that you created to see if CSV files have been downloaded. You should have some in there but there should be 8 total as mentioned above.

    Hope this helps get some more comprehensive data for you in your SEO activities.

    Best,

    Shawn
     
    • Thanks Thanks x 2
  2. innozemec

    innozemec Jr. VIP Jr. VIP

    Joined:
    Aug 19, 2011
    Messages:
    5,288
    Likes Received:
    1,799
    Location:
    www.Indexification.com
    Home Page: