howtos » Uncategorized

There is a great quantity of quality resources to help get you started on making your first geo mashups. This page links to all those great resources from one easy location.


Google Maps API


YouTube videos

View a full list of Maps API videos here


Google Maps API Intermediate (44:11) Google Maps API Advanced (50:17)




Google Street View API

The Street View API allows you to leverage Google’s unique Streetview imagery and controls within your mashups. Streetview is currently available for selected locations in the US, Australia, and Japan.


Google Mapplets API

Mapplets are a combination of the Maps API and Gadgets API, and provide a great platform for making your maps mashups discoverable and permanent via the mapplets directory.


Google Earth API


Google Earth


If a user types in or follows a URL that does not exist on a website they are usually taken to a 404 (page not found) page.  Returning a standard 404 page to your user tends to provide a less-than-optimal user experience and may cause you to lose them altogether. 

A solution is now at hand.  Create a custom 404 page and embed a Webmaster Tools 404 widget into it.  The 404 widget helps your visitors find what they’re looking for by providing suggestions based on the incorrect URL.  It also provides a link to the parent subdirectory, a sitemap webpage, and a site search query suggestions and search box.

The Google Maps API is a great way to utilise Google’s Maps platform on your own website. The standard Maps API, however, does not work in e-mails as it is reliant on JavaScript which most (if not all) e-mail clients block.



Luckily there is a solution thanks to the Google Static Maps API. The Static Maps API generates an image file that can be embedded into your HTML content (like below). Because it is an image, and there is no JavaScript involved, mail clients will display such a map. You can specify the location of the map, the size of the image, the zoom level, the type of map, and the placement of optional markers at locations on the map using the API. For example:



Singapore MRT stations



Sydney - Pitt St Mall to Hyde Park



Getting started is easy!

  1. Sign up for a Google Maps API key
  2. Use the Google Static Map Wizard to create your first static map
  3. Read the Google Maps Static API documentation



This method is great for also providing map content in other mediums that don’t support JavaScript - such as mobile content.

Disclaimer: I’m a Python newbie … if you know of a more efficient way let me know!

I needed to take a sequence of 4 digits (eg 1145) and modify it to look like clock-time (eg “11:45″). After a bit of online (what else?) research I decided to take the approach of converting the integer to a string and then to a list (of characters). I then insert the extra character (ie the “:”) into the list at the right position. Finally, join the list elements together to form a new string.


time_int = 1145
time_str = str(time_int)
time_list = list(time_str)
time_list.insert(2, ‘:’) #insert the ‘:’ character into the list before position 2
time_str = “”.join(time_list)

CODE:
  1. list = ['one', 'two', 'three', 'one', 'one', 'four', 'two']
  2. #convert the list into a set.  An element can only exist once within a set
  3. set = set(list)
  4. #convert the set back into a list type
  5. list = list(set)
  6. print list

Are those variable names confusing? Let's look at that example again:

CODE:
  1. fruits = ['apple', 'bananas', 'cantaloupes', 'apple', 'apple', 'durian', 'bananas']
  2. #convert the list into a set.  An element can only exist once within a set
  3. fruits_unique = set(fruits)
  4. #convert the set back into a list type
  5. fruits = list(fruits_unique)
  6. print fruits

Your dilemma: You want to create a Google Analytics Goal that defines a Goal URL using a regular expression match.  But how do you test it without having to wait 24 hours for your Google Analytics reports to be updated?


Help is at hand: Regular expressions can be tested using the search box in Google Analytics reports.  That's right - the search box available in all reports can take and interpret regular expressions.  Let's say that you intend to use the following regular expression as your Goal URL:


/goal_page\.html\?cid=[123][abc]-.*&.*


First, copy the regular expression into your clipboard.  Then navigate to the Content > Top Content report.  Paste the regular expression into the search box that sits below the table of data.  Now click on the "Go" button.


Do you see your Goal URL(s) in the returned report?  If yes - great, you're good to go!  If no - you will need to spend some time refining your regular expression.  Tools like  RegExr and  The Regex Coach are useful for this.


There you have it - an easy way to test your regular expressions without having to wait 24 hours for your reports to update.


This method can also be used to test regular expressions for your filters.  For example, if you have a custom filter for the "Visitor Country" field that uses a regular expression, test that expression in the Visitors > Map Overlay report.

When reading your AdWords reports in Google Analytics, there are many possible reasons why there may be discrepancies between Google Analytics visits and AdWords clicks.  If you see wildly different numbers for visits and clicks, the likely culprit is that the AdWords auto-tagging parameter is being stripped from the landing page URL.

What happens when you have auto-tagging enabled in your AdWords account?  Any time one of your ads is clicked on, AdWords will automatically append a paramater called the gclid (Google CLick ID) on to the end of the ad's destination URL.

For example, if your ad's destination URL is http://www.mysite.com/landing_page.html and a user clicks on your ad, AdWords will redirect the user to http://www.mysite.com/landing_page.html?gclid=123fa35fjn809080jk (the gclid value is a random string)

The gclid value is a unique identifier that identifies which ad (and consequently keyword, ad group and campaign) the visitor clicked on to reach your site.  When Google Analytics processes your reports, it fills in the AdWords reports by looking up the appropriate gclid values in the AdWords database to find the corresponding information.

Here's the key point: Google Analytics cannot tell if the visitor came from an AdWords click if the gclid parameter is missing on the page that the user eventually lands on!

The key is to test whether your landing page retains the gclid parameter.

  1. Take your destination URL (eg http://www.yoursite.com/landing_page.html) and paste it into your browser's location bar (where you usually type in a web address)
  2. Add a test parameter on to the end of the URL.  If your URL does not already have parameters in it, append ?gclid=test.  If there are already parameters, append &gclid=test on to the end.  (For example, http://www.yoursite.com/landing_page.html becomes http://www.yoursite.com/landing_page.html?gclid=test; and http://www.yoursite.com/landing_page.html?myval=1 becomes http://www.yoursite.com/landing_page.html?myval=1&gclid=test)
  3. Press enter
  4. Your browser will take you to your landing page.  Be mindful of redirects, especially if you are tracking with Doubleclick, Atlas, etc tags.
  5. Is the gclid=test parameter still visible in your browser's location bar?


YES? Auto-tagging plays nice with your destination URLs.  You can stop reading now!

NO? Oh-oh.  There is most likely an intermediate redirect that is stripping out the gclid parameter. There are two options to remedy this:

  1. First (and easiest) - change your destination URL to the ultimate page that the visitor lands on, thus bypassing any redirects
  2. Configure your server so that the gclid parameter is passed along in the redirect


(Two other common culprits are users are landing on a 404 error page or the Google Analytics tracking code missing altogether on the landing page!)

There you have it - how to test if your destination URLs play nice with auto-tagging.  For more information, read Google's help center article on auto-tagging.