Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Readme.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ See [Google Analytics Tracking Methods](https://developers.google.com/analytics/
tracker_methods = {
:setDomainName => "example.com", # String argument
:setAllowLinker => true, # Boolean argument
:require => ['inpage_linkid', '//www.google-analytics.com/plugins/ga/inpage_linkid.js'] # Array argument (will be splattered)
:clearOrganic => "" # No argument
}
```
Expand Down
4 changes: 4 additions & 0 deletions lib/split/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def insert_tracker_methods(tracker_methods)
when FalseClass
# Boolean argument tracker method
arr << "_gaq.push(['" + "_" + "#{k}', #{v}]);"
when Array
# Array argument tracker method
values = v.map { |value| "'#{value}'" }.join(', ')
arr << "_gaq.push(['" + "_" + "#{k}', #{values}]);"
end
end
end
Expand Down