Skip to content

Commit

Permalink
Analytics: Allow defining events outside of analytics.js
Browse files Browse the repository at this point in the history
Conflicts:
	r2/r2/public/static/js/analytics.js
  • Loading branch information
Matt Lee committed Oct 7, 2016
1 parent ad08159 commit c23a188
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions r2/r2/public/static/js/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ r.analytics = {

r.analytics.firePageTrackingPixel(r.analytics.stripAnalyticsParams);

r.hooks.get('analytics').call();
},

_eventPredicates: {},
Expand Down Expand Up @@ -509,6 +510,12 @@ r.analytics = {

r.events.track(eventTopic, eventType, payload).send();
},

sendEvent: function(eventTopic, actionName, defaultFields, customFields) {
var eventType = 'cs.' + actionName;
var payload = this.addContextData(defaultFields, customFields);
r.events.track(eventTopic, eventType, payload).send();
},
};

r.analytics.breadcrumbs = {
Expand Down

0 comments on commit c23a188

Please sign in to comment.