Skip to content

Analytics: Allow known optouts#7318

Merged
avimehta merged 3 commits intomasterfrom
avimehta-patch-1
Feb 3, 2017
Merged

Analytics: Allow known optouts#7318
avimehta merged 3 commits intomasterfrom
avimehta-patch-1

Conversation

@avimehta
Copy link
Copy Markdown
Contributor

@avimehta avimehta commented Feb 3, 2017

Added an additional condition to assert to confirm that if optout is used outside of predefined config, it is only what we expect it to be.

Copy link
Copy Markdown
Member

@cramforce cramforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG with one comment.


user().assert(opt_predefinedConfig || !from || !from['optout'],
user().assert(opt_predefinedConfig || !from || !from['optout'] ||
from['optout'] == '_gaUserPrefs.ioo',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: indent at +4

Please document why this exception and that we are happy to add more such exceptions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Not sure if we'll need to do this again in future.

}

user().assert(opt_predefinedConfig || !from || !from['optout'],
user().assert(opt_predefinedConfig || !from || !from['optout'] ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a helping of comments for this unintuitive expression.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


user().assert(opt_predefinedConfig || !from || !from['optout'],
user().assert(opt_predefinedConfig || !from || !from['optout'] ||
from['optout'] == '_gaUserPrefs.ioo',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this function get injected into the page?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browser extension

@avimehta avimehta merged commit 89a7cd0 into master Feb 3, 2017
@jridgewell jridgewell changed the title Update amp-analytics.js Analytics: Allow known optouts Feb 3, 2017
erwinmombay pushed a commit that referenced this pull request Feb 3, 2017
* Update amp-analytics.js

* review feedback.

* Update amp-analytics.js
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Feb 14, 2017
* Update amp-analytics.js

* review feedback.

* Update amp-analytics.js
@mrjoro mrjoro deleted the avimehta-patch-1 branch February 23, 2017 17:19
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
* Update amp-analytics.js

* review feedback.

* Update amp-analytics.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants