Archive for the ‘Google’ Category
This is a cross-post from the Tquila blog.
Not having analytics built into your public sites is much like having a Q&A site but not allowing people to answer. In this case some of the questions are:
- Where did you come from?
- How long did you stick around for?
- Where did you hang out on your visit?
Now I’m not going to debate which set of analytics is best but I did come across a few quirks when setting Google Analytics (GA) up for wesnolte.com that I suspect are fairly universal.
Build a Site
This of course is quite a big step and I’m going to assume you’re just about done. To get analytics up and running though you’re going to have to do a few extra bits.
- Sign up for a GA account, create a Website Profile and you’ll receive an Analytics Code. My code has been blocked out in orange in the image alongside, your code should appear in it’s place.
- Insert the standard Google Analytics Visualforce component into your page.
- Enter the same Analytics Code as above on the Force.com Site Detail page – the field is called “Analytics Tracking Code”.
If you go back to your Analytics home page and refresh you’ll see a little warning sign that tells you something is amiss – and it is but it’s difficult to figure out just what that something is.
The problem in this case is that the default robots.txt file for Force.com Sites blocks all bots. This is not a bad idea but it’s not obvious when setting all this up.
Michaelforce and myself seemed to have had these pains at the same time and he posted his findings here. You’ll need to apply step 3 from his post to allow GA to peek at your site.
My analytics are working a charm but I’ve realised there’s a snag. Since salesforce.com doesn’t allow you access to their nameservers you have to point your root domain to your Force.com Site using URL forwarding at the domain registrar’s side i.e. I can use a CNAME to point www.wesnolte.com to my Force.com site but wesnolte.com has to bounce to my registrars forwarding server before it finally hits the real site. What this means is that – to GA – the traffic directly to wesnolte.com looks like it’s all coming from one source, that is the forwarding server. The only way that I know to work around this is to get people to only use the http://www.domain.com form of your URL – not ideal I know.
This seems to be a problem that nearly everyone hits when starting with GWT. It causes confusion because the code is error free at compile time, yet throws a java.lang.NoClassDefFoundError exception at runtime. The problem is simple to correct.
You’ll probably have included the required library into your build path already and that’s why you’re not getting compile time errors. The additional step that is to have the JAR-file(s) that contain the required libraries be copied to your project’s war/WEB-INF/lib directory. Note that your JAR-files must exist in the root of this directory, and not in any sub-directories.
Salesforce could be regarded as the cloud computing leader but history tells us that many-a-giant has fallen before. Apple has; Microsoft has; IBM has. I think Salesforce is still on the up ‘n up, but there are contenders out there and some of them are noteworthy; probably the most obvious of these is Google. Over the past few months I’ve dug into the Google cloud platform and I thought it was time to attempt a side-by-side comparison of my two favourite PaaS providers.
Some quick definitions are probably in order:
Force.com is a cloud computing platform as a service offering from Salesforce, the first of its kind allowing developers to build multi tenant applications that are hosted on their servers as a service.
Google App Engine is a platform for developing and hosting web applications in Google-managed data centers.
Salesforce.com is an ever increasing presence on the interweb. They’re leaders in a market that promises to be the next generation of software development, that of cloud computing. Google, Amazon and Mosso are some other names that have realised the current and potential power of developing and/or hosting in the cloud and it’s an area that I’m glad to be involved in from so early on.
Although this tech is not new, it is still young, and I’ve started this blog as a way to contribute to the growing community of Cloud Computing developers. The teething problems are still quite apparent in this industry, and as someone who’s been heavily involved in the technology for some time, I’m starting to see how problematic certain aspects of this type dev are(although the benefits far outweigh the drawbacks). Read the rest of this entry »