Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ amp-subscriptions: Add logging to analytics events #19173

Merged
merged 2 commits into from Nov 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions extensions/amp-subscriptions/0.1/analytics.js
Expand Up @@ -16,6 +16,9 @@

import {dict} from '../../../src/utils/object';
import {triggerAnalyticsEvent} from '../../../src/analytics';
import {user} from '../../../src/log';

const TAG = 'amp-subscriptions';

/**
* subscriptions-platform-* event names are deprecated in favor
Expand Down Expand Up @@ -65,6 +68,7 @@ export class SubscriptionAnalytics {
* @param {!JsonObject=} opt_vars
*/
event(eventType, opt_vars) {
user().info(TAG, eventType, opt_vars || '');
triggerAnalyticsEvent(this.element_, eventType, opt_vars || dict({}));
}
}