Conversation
|
@jaswrks this PR is not passing some JS tests. Mostly due to an attempt to access |
zinigor
left a comment
There was a problem hiding this comment.
Makes sense to me, looks good, except I have one question.
| error: error, | ||
| updatedOption | ||
| } ); | ||
| maybeSetAnalyticsOptOut( updatedOption ); |
There was a problem hiding this comment.
Why is this getting set in the catch block instead of in the success block?
|
@oskosk writes...
Thank you. I see what you mean. I reviewed the Travis output and I see this is a result of me importing Does anyone have a suggestion about how to best approach a fix for this and get tests to pass? Am I doing something really unexpected by importing the analytics code in this PR? Or is this missing |
Copy that :-) Ty |
da1219f to
bc3d5c4
Compare
|
A potentially better alternative now exists in #9156 |
|
Closing, superseded by #9156 |
NOTE: Please consider merging #9156 instead of this.
PR Objectives
Implement the upcoming
setOptOutcommand; i.e., whenever the new privacy option is changed, this PR will set or unset the opt-out cookie usingwindow._tkq.push( [ 'setOptOut', true|false ] )Make
Jetpack_Tracks_Clientin PHP aware of this cookie too. If the opt-out cookie exists, do not record server-side events either.How to test:
Depends on Add new settings route and page for Privacy settings #8993 and Add/user tracking option api #9003These are merged already.localStorage.setItem( 'debug', 'dops:analytics' );Pushing setOptOut: true|falseBlocker
This will not actually set the cookie, it merely logs what would occur if
setOptOutexisted. Therefore, this PR cannot be tested any further at this time. The work in gh-analytics-38 (setOptOutcommand) needs to exist inw.jsas well, which I am investigating.Unresolved QuestionsWill the final option key for opt-outs in Jetpack remainYesjetpack_event_tracking? This question has been raised in: p7kMJG-4rC-p2 and is pending further discussion.ShouldNosetOptOutdisable Google Analytics in addition to Tracks?