Skip to content

Commit

Permalink
Turn off "hidden-v3" (ampproject#9026)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyx authored and Eric Kenney committed May 3, 2017
1 parent 94311c2 commit d57415c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions extensions/amp-analytics/0.1/instrumentation.js
Expand Up @@ -571,8 +571,7 @@ export class AnalyticsGroup {
addTrigger(config, handler) {
let eventType = dev().assertString(config['on']);
// TODO(dvoytenko, #8121): Cleanup visibility-v3 experiment.
if ((eventType == 'visible' || eventType == 'hidden')
&& this.visibilityV3_) {
if ((eventType == 'visible') && this.visibilityV3_) {
eventType += '-v3';
}
let trackerProfile = EVENT_TRACKERS[eventType];
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-analytics/0.1/test/test-instrumentation.js
Expand Up @@ -235,10 +235,10 @@ describes.realWin('InstrumentationService', {amp: 1}, env => {
analyticsElement, 'visible-v3', config, handler);
});

it('should add "visible-v3" trigger for hidden', () => {
it('should add "visible-v3" trigger for hidden-v3', () => {
toggleExperiment(win, 'visibility-v3', true);
group = service.createAnalyticsGroup(analyticsElement);
const config = {on: 'hidden'};
const config = {on: 'hidden-v3'};
const getTrackerSpy = sandbox.spy(root, 'getTracker');
group.addTrigger(config, () => {});
expect(getTrackerSpy).to.be.calledWith('visible-v3');
Expand Down

0 comments on commit d57415c

Please sign in to comment.