Skip to content

Add user tracking endpoint proxy for tracks_opt_out#9142

Merged
dereksmart merged 4 commits intomasterfrom
add/user-tracking-endpoint
Mar 27, 2018
Merged

Add user tracking endpoint proxy for tracks_opt_out#9142
dereksmart merged 4 commits intomasterfrom
add/user-tracking-endpoint

Conversation

@jaswrks
Copy link
Copy Markdown
Contributor

@jaswrks jaswrks commented Mar 23, 2018

Changes proposed in this Pull Request:

  • Adds a new endpoint proxy for D11180-code (to get/set tracks_opt_out). Note that D11180-code has been merged already and is now live.
  • Uses a new utility added by this PR: Jetpack::current_user_ip()

Testing instructions:

jaswrks added 2 commits March 23, 2018 11:53
- Add endpoint proxy for D11180-code
- Add `Jetpack::current_user_ip()` with `$check_all_headers` param.

Depends on: #9122
@jaswrks jaswrks added [Status] Needs Review This PR is ready for review. [Focus] GDPR labels Mar 23, 2018
@jaswrks jaswrks added this to the GDPR Compliant milestone Mar 23, 2018
@jaswrks jaswrks requested a review from a team as a code owner March 23, 2018 20:47
@zinigor
Copy link
Copy Markdown
Contributor

zinigor commented Mar 26, 2018

Technically I have no problem with this, it builds nicely on the code that is already merged into Jetpack. What I'm concerned about is this: we are adding a new endpoint here, can't we instead use an existing /settings endpoint? This would be more RESTful in my opinion. And if we are creating a new endpoint, and you feel it's justified, can we at least call it something like jetpack/tracking?

@mattwiebe
Copy link
Copy Markdown
Contributor

mattwiebe commented Mar 26, 2018

EDIT I misunderstood the wpcom API endpoint vs the Jetpack site endpoints

We would have preferred to use the existing user/settings API, but it's on the wpcom v1 API, which does not have any Jetpack-based user auth capabilities built-in.

can we at least call it something like jetpack/tracking?

It's called jetpack-user-tracking right, now which I see as more descriptive, although I guess if you want it a bit more RESTful, we could do jetpack/user-tracking

@jaswrks
Copy link
Copy Markdown
Contributor Author

jaswrks commented Mar 26, 2018

@zinigor Thank you for the review, much appreciated :-)

What I'm concerned about is this: we are adding a new endpoint here, can't we instead use an existing /settings endpoint?

I see what you mean about the Jetpack /settings endpoint.

I used a separate endpoint out of concern for permissions. Currently, this endpoint is much more user-centric than /settings, and it can be accessed by both wpcom-connected users, and also by users who are not wpcom-connected.

In the case of a user not being connected to a WP.com account, we simply do not track them. That's a short-term solution. Having this separate endpoint affords us some leeway with respect to permissions -- in case a more long-term solution presents itself in the near future.

And if we are creating a new endpoint, and you feel it's justified, can we at least call it something like jetpack/tracking?

Good suggestion. How about /tracking/settings ?
Or, seeing as this is user-centric, how about /user/tracking/settings ?

@dereksmart dereksmart modified the milestones: GDPR Compliant, 6.0 Mar 26, 2018
@jaswrks
Copy link
Copy Markdown
Contributor Author

jaswrks commented Mar 26, 2018

Endpoint changed to /tracking/settings

mattwiebe added a commit that referenced this pull request Mar 27, 2018
Update the UI to use the WPCom user tracking opt-out API.

Depends on #9142 and #9154
Copy link
Copy Markdown
Contributor

@mattwiebe mattwiebe left a comment

Choose a reason for hiding this comment

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

Solid work here

Copy link
Copy Markdown
Contributor

@zinigor zinigor left a comment

Choose a reason for hiding this comment

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

Thanks for changing the name, looks good to me!

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Mar 27, 2018
@dereksmart dereksmart merged commit 2a8831b into master Mar 27, 2018
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Mar 27, 2018
@dereksmart dereksmart deleted the add/user-tracking-endpoint branch March 27, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants