Skip to content

Instantly share code, notes, and snippets.

@prsanjay
Created June 3, 2018 16:19
Show Gist options
  • Save prsanjay/6d8f6fd407721a7438e2cd6a08571e59 to your computer and use it in GitHub Desktop.
Save prsanjay/6d8f6fd407721a7438e2cd6a08571e59 to your computer and use it in GitHub Desktop.
Customize Ahoy tracking method
class Ahoy::Store < Ahoy::DatabaseStore
def track_visit(data)
data[:accept_language] = request.headers["Accept-Language"]
super(data)
end
def track_event(data)
data[:properties] = { key: 'value' }
super(data)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment