chrisle/gattica — pull request #26 by jasonfox (2013-03-13 19:32:46+00:00)
Title: No need to split dimension/metic values on a colon

I tracked down an issue I was having where URLs which contained a colon character were not being properly included in the Gattica results. For example, this crazy URL from our Google Analytics account:

/stories/Rida-Asim-Wins-Scholastic-Regional-Art-and-Writing-Award/209582?fb_action_ids=10151390356368347&fb_action_types=og.likes&fb_source=other_multiline&action_object_map={"10151390356368347":524248140960991}&action_type_map={"10151390356368347":"og.likes"}&action_ref_map=[]

...was being returned as: "og.likes"}&action_ref_map=[]

This was due to the following line in the DataPoint model's initializer:

{ dimension.attributes['name'].split(':').last.to_sym => dimension.attributes['value'].split(':').last }

I understand why you are splitting the dimension/metic names on a colon but I do not believe that you have to split the values. For example you would want to split the name ga:pagePath to get pagePath but not the value: /foo/bar?baz=123. Let me know if I'm wrong about this.