Category Archives: Google

Google Analytics Event Tracking for Universal Code

Google AnalyticsYou may not have realized that since Google Analytics made the switch to its Universal Analytics code you event tracking code has to change. The common error resulting from using classic analytics event tracking syntax with the new Universal Analytics code is:

Uncaught ReferenceError: _gaq is not defined

This is because the new code uses ‘ga’ instead of ‘_gaq’.

Also, the syntax of the call has changed. If you don’t update the syntax you may end up with this error:Uncaught syntax error”: Unexpected identifier

Uncaught syntax error”: Unexpected identifier

Here’s an example of what you use with classic analytics:
onClick=”_gaq.push([‘_trackEvent’, ‘Phone’, ‘Click’, ‘Click to Phone’]);”

What you should be using now looks more like this:
onClick=”ga(‘send’, ‘event’, ‘Phone’, ‘Click’, ‘Click to Phone’);”

Using Google Voice Search Hotword Chrome Extension Outside the US

Google Voice Search Chrome Extension
Google Voice Search Chrome Extension

Yesterday Google released a new Chrome extension that allows you to initiate a voice search from the Google search page by simply saying “OK Google”, much like you do in Google Now for Android or iPhone. This is a very handy feature that works quite well.

Unfortunately for those outside of the US, this feature won’t work by default. There is an easy workaround though.

By default, if you try to go to google.com outside if the US you will be redirected to your country specific page. E.g. In Canada you will be redirected automatically to google.ca

Since you’re not on google.com, the Google Voice Hotword Extension won’t work.

The workaround is as follows:

That’s it. The ‘ncr’ at the end of the URL stands for No Country Redirect. Using this will force your browser to use google.com instead of your country specific search page.

Another tip:

  • One thing to be aware of is that going to the /ncr version of the Google search page will result in a cookie being set on your browser. This cookie will make your browser use the /ncr version all the time. If you still want to use your country specific search page sometimes and don’t want to have to delete the cookie each time, simply do your search by using an incognito window to perform your voice search (⌘-Shift-N on Mac). The cookie will only be set for that window so you’re good to go anytime you want to go back to using your country specific search page.

Google Voice Search Chrome Extension

Resolving ‘Bad Request Error 400’ in Gmail on Chrome

Gmail on Chrome: Bad Request Error 400
Gmail on Chrome: How to resolve the Bad Request Error 400

I periodically come across the “Bad Request Error 400” problem when using Gmail on Google Chrome. I’m not the only one as you can see from a Google search on the topic. One minute all is well and the next, reload after reload all you see is a blank page and this error message. You haven’t changed anything but things just don’t work anymore. If you try accessing Gmail on a different browser like Firefox, everything seems good, so it’s not Gmail itself; it’s the combination of Gmail and Chrome.

It seems quite ridiculous really that this issue should happen on Chrome. Shouldn’t Gmail on Chrome be essentially bulletproof? Google on Google. C’mon.

When looking for answers the most common suggestion you’ll find is to clear all of your browsing data; history, cache, cookies, etc. I happen to like my browsing data. Among other things, it helps me find things and allows me to stay logged in on various sites. Deleting it all causes me pain.

After searching through various sites and the Gmail and Chrome forums I finally found a great solution. It turns out deleting all of your browsing data is not necessary. This problem comes down to one solitary cookie. Delete this cookie and life is good again.

How to resolve the Bad Request Error 400 in Gmail

Here are the exact instructions.

– Right click on the page with the error
– Select “Inspect Element” from the right click menu
– Select the “Resources” tab at the top of the Developer Tools pane or window that opens up
– Expand the “Cookies” section on the left side navigation by clicking on the little triangle next to “Cookies”
– Select the “mail.google.com” cookie
– Right click on “GMAIL_IMP”
– Select “Delete”
– Refresh the error page

– Rejoice

Original source of solution