Skip to content

Instantly share code, notes, and snippets.

View yields's full-sized avatar
:octocat:
☕ 💻

Amir Abushareb yields

:octocat:
☕ 💻
View GitHub Profile
// sources: https://segment.io/libraries/analytics.js#getting-started
// https://github.com/phillbaker/analytics-js-rails/blob/master/app/views/analytics-js/_loader.html.erb
// Create a queue, but don't obliterate an existing one!
window.analytics || (window.analytics = []);
// A list of all the methods in analytics.js that we want to stub.
window.analytics.methods = ['identify', 'track', 'trackLink', 'trackForm',
'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready',
'group', 'on', 'once', 'off'];