Ruby Week Startup Crawl! »

Created at: 11.11.2009 23:30, source: Engine Yard Blog, tagged: events rubyconf

Startup Crawl

Next week is going to be quite the week for Ruby in San Francisco, with QCon, RubyConf and JRubyConf. Engine Yard is excited to be participating in all three events, but there’s even more to tell you about!

With so many Rubyists in town, it only made sense to find a way to have you all over for drinks and socializing. As such, we’ve signed on to participate in the RubyConf week Startup Crawl. We’re working with our friends over at Scribd, along with a host of other local startups (Zendesk, Yammer, Justin.tv and more!) and opening our doors to everyone.

The Crawl will take place Friday evening, November 20th; there will be buses leaving from the RubyConf hotel starting at 5:30 and making trips back and forth until 11 p.m. We’ll have food, drinks, giveaways, and of course Engine Yard Cloud demos for all.

If you’re planning on taking the bus, be sure to sign up at the Startup Crawl site, so we can be sure there’s enough transportation for everyone. Otherwise, feel free to walk in any time after 5:30—we’d love to meet you!


more »

Tracking Google Analytics events in development environment with GoogleAnalyticsProxy »

Created at: 01.11.2009 21:55, source: Robby on Rails, tagged: Ruby on Rails PostgreSQL javascript analytics kpi googleanalytics events proxy opensource github prototype

As mentioned in a recent article1, I’ve been diving deep into Google Analytics lately while working on a few client projects. We’re aiming to use much more of the features of Google Analytics and have been hitting some roadblocks with the development versus production application environments. Once you begin to dive into event tracking and AJAX-driven goal conversions, relying on just the sample code that Google Analytics provides you is going to result in you looking at a handful of JavaScript errors.

pageTracker is not defined

another example from the firebug javascript console…

firebug pageTracker is not defined

We see JavaScript errors like this because we don’t load the google analytics code in our development environments. As you can see, we are only loading this in our production environment.

  <% if RAILS_ENV == 'production' -%>
    <!--// Google Analytics //-->
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-XXXXXX-1");
    pageTracker._trackPageview();
    </script>
  <% end -%>

To track an event with Google Analytics, you’d need to trigger something like:

  pageTracker._trackEvent('Button', 'Click', 'Get in touch');

As you can see from our code earlier, in development, the pageTracker variable isn’t defined and that’s why we’re getting those JS errors. We also don’t want to add conditionals everywhere in our application to check if we’re in development or production environment.. as that’d just make our views uglier than they need to be. So, I decided that I’d create a proxy class in JavaScript that would allow us to trigger _trackEvent() and _trackPageview() and handle it appropriately.

This class works with the following logic:

  • if google analytics is loaded, pass the parameters to the real pageTracker
  • if google analytics is NOT loaded, output the information to console.log() for debugging purposes

For example, on a gallery on our web site… we track when people navigate next and/or previous through the photos. In our development environment, I can watch the JavaScript console output the following:

Firebug - GAP

And in our production environment, we can see that this was sent to Google Analytics.

Firebug - trackEvent()

We’re able to do this by initializing the GoogleAnalyticsProxy class and calling these functions through it. For example:

  _gap = new GoogleAnalyticsProxy();
  _gap._trackEvent('Video', 'Play', 'Homepage video');
  _gap._trackEvent('Video', 'Pause', 'Homepage video');
  _gap._trackEvent('Button', 'Click', 'Call to action X');

You’ll see that we’re just calling _gap versus pageTracker. We then replace all the instances of pageTracker (except where it is defined in the google analytics code block they provide you). You’ll find this located near the bottom of our application.html.erb file.

<% if RAILS_ENV == 'production' -%>
  <!--// Google Analytics //-->
  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  var pageTracker = _gat._getTracker("UA-XXXXXX-1");
  pageTracker._trackPageview();
  </script>
<% end -%>

<script type="text/javascript">
  var _gap = new GoogleAnalyticsProxy();
</script>

We now have _gap available throughout our project and can call _trackEvent() and _trackPageview() with it. Note: You can use any JS variable name that you want, _gap is just what I went with.

Get GoogleAnalyticsProxy

I’ve gone ahead and tossed this small JavaScript class (known as GoogleAnalyticsProxy) on Github for your enjoyment. I have some more articles in the works that will show you some tips for how to make the most of Google Analytics. If you have any questions and/or ideas for related article topics, don’t hesitate to let me know.

1 Tracking AJAX-driven events in Ruby on Rails for Google Analytics conversion goals


more »

Want To Speak At RailsConf 2010? Submit Your Proposals Now »

Created at: 28.10.2009 21:41, source: Rails Inside, tagged: events News

railsconf-logo.pngWant to impress your fellow Rails developers? Want to get a free pass to the world's definitive Rails conference to see great keynote speakers of the caliber of Tim Ferriss? Submit a proposal to speak at RailsConf 2010 - taking place June 7-10, 2010 in Baltimore, Maryland, USA. Yep, the call for participation opened today!

Speaking at RailsConf is a great addition to your CV and a lot of RailsConf's speakers have been first timers. From what I've seen over the years, there doesn't seem to be a pattern to who gets in and who doesn't (though bigger names do, certainly, seem to pop up more - but perhaps they submit the most proposals..) and as long as you can come up with a solid Rails-related talk proposal, you're in with a good chance.

The official call for proposals outlines some areas that would be preferred:

  • Time-saving developer productivity tips, tricks, and tools
  • Patterns and best practices for developing maintainable Rails applications
  • Rails Internals
  • Complex domain modeling
  • Rails development case studies, including application rewrites and organizational bootstrapping
  • Making Rails
  • Heterogeneous systems integration
  • Real-world deployment and scaling
  • Making the most out of new Rails features
  • Gem and Plugin highlights
  • Extending Rails

Proposals are due by 11:59pm Eastern on March 17, 2010 and successful speakers will be notified in April. Good luck!

Post to Twitter Tweet This Post


more »

It's a wrap! »

Created at: 04.06.2009 18:45, source: has_many :through, tagged: conference events gogaruco Sightings

We're finally getting all our after-conference activities completed. The most exciting thing is that we just got our conference media online. We have video and audio recordings of the Golden Gate Ruby Conference technical sessions! Pivotal Labs sponsored the recordings, and is hosting them at pivotallabs.com/gogaruco - you can watch them there or download the files to watch later, or get them from the iTunes podcasts.

We also are trying something new (for Ruby confs, at least). We have put together a 42 page PDF zine, the Golden Gate Ruby Wrap, in order to document the conference, the speakers, the sessions, and the attendees. There are a lot of photos of the event, speaker bios, talk write-ups, and even interviews with attendees. It's the official record of the conference (as official as we get, anyway), and it's free.

Just because people have been asking, I'll say that Matt Aimonetti's talk on CouchDB is not included in the talk videos. Matt didn't want to offend anyone else, so he asked the talk recording not be released. Please don't ask for a copy privately, as I can't help you out. However, there is a great write-up of Matt's talk in the Wrap.

I'd also encourage you to check out the gogaruco blog posts at Pivotal Labs - there are articles for every session at the conference. Sarah Allen also blogged many of the sessions at her site. Know of any other good posts about sessions? Let us know in the comments.

And if you want to see how things looked, there are a lot of good photos up on flickr.


more »

Announcing Golden Gate Ruby Conference »

Created at: 23.01.2009 04:47, source: has_many :through, tagged: conference events ruby

This has been a long time coming, and I'm very happy to finally be able to announce the first ever Golden Gate Ruby Conference, here in San Francisco on April 17 and 18. There's so much interest in Ruby here in SF, and tons of Ruby mojo too, so it's about time we had our own conference! We'll be bringing in some great speakers from all over so locals who don't get to travel to conferences can get exposed to stuff they can't usually see. And we'll also have some of our high-powered local talent showing off their stuff too.

While this has been in the works for a while, there are still a few details to work out before we can talk about things like registration, price, our speaker lineup, etc. But we wanted to get the word out as soon as we had firm dates so people could get it on their calendars. And there's still a lot we can talk about...

The organizers of the conference are yours truly, Josh Susser ("the has_many :through guy"), and Leah Silber, conference addict and the woman Yehuda Katz was lucky enough to marry. Yehuda is going to be helping me with the technical program too. Our employers, Pivotal Labs and Engine Yard are already committed to sponsor the conference, so we know we have plenty of support to make it happen. There are still a lot of opportunities to get involved as a volunteer or a sponsor, and we're actively looking for both.

Our approach to this conference is not to take anything as a given. We're rebels, we're bucking the system, we're using instance_eval to leave out explicit receivers! For starters, there will be no call for proposals for talks. The program will consist of invited talks, and talks selected by attendee voting. We'll be setting up a site soon where talks can be proposed and voted on.

We've also got a GitHub account set up as a one-stop place where you can find all the code talked about at the conference, and a place to put stuff we may be hacking on over the weekend. Of course you can follow the conference on twitter, and we'll have a blog set up soon enough.

We're shooting for 150-200 people, single track, about a dozen talks, plenty of "hallway track" time, and a few surprises.

If you want to get involved, volunteer or sponsor, the email addresses on gogaruco.com are the best way to contact us.

Looking forward to this. You have no idea...


more »