diff --git a/lib/rack/tracker/google_analytics/google_analytics.rb b/lib/rack/tracker/google_analytics/google_analytics.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/tracker/google_analytics/google_analytics.rb
+++ b/lib/rack/tracker/google_analytics/google_analytics.rb
@@ -1,5 +1,12 @@
 require 'ostruct'
 
+# Backport of 2.0.0 stdlib ostruct#to_h
+class OpenStruct
+  def to_h
+    @table.dup
+  end unless method_defined? :to_h
+end
+
 class Rack::Tracker::GoogleAnalytics < Rack::Tracker::Handler
   class Event < OpenStruct
     def write
test backport of ostruct#to_h on travis