Skip to content

Conversation

@dereksmart
Copy link
Contributor

@dereksmart dereksmart commented Mar 6, 2018

Must be merged after #9003 is merged. It's merged

This PR introduces a new page accessible through the Privacy link at the bottom of the Jetpack dashboard.

captura de pantalla 2018-03-21 a la s 23 46 58

The page features links to the Automattic privacy policy and to the upcoming privacy.blog. The support link goes through what data does Jetpack sync.
The page also introduces a toggle so users can opt-out of information tracking that Automattic collects for its own purpose.

captura de pantalla 2018-03-09 a la s 20 01 36

Changelog entry

Introduced a new Privacy admin page linked at the bottom of the Jetpack dashboard.

@dereksmart dereksmart requested a review from a team as a code owner March 6, 2018 22:01
@jeherve jeherve added this to the GDPR Compliant milestone Mar 7, 2018
@ghost ghost assigned eliorivero Mar 8, 2018
@eliorivero
Copy link
Contributor

eliorivero commented Mar 8, 2018

In 805141f, I added smooth scroll that will take user to the height of the navigation bar when the Privacy link is clicked.
The reason for this is that when I clicked on the link, nothing seemed to happen. I initially thought it was broken until I scrolled up and saw that it had indeed changed.

/**
* External dependencies
*/
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing PropTypes import

import SettingsGroup from 'components/settings-group';
import { ModuleToggle } from 'components/module-toggle';
import { updateSettings } from 'state/settings';
import { getSettings } from 'state/settings';
Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines import selectors from the same place. The linter should throw an error ( cc @oskosk ) because we should have a single line importing everything needed from a particular bundle of selectors.


class Privacy extends React.Component {
static displayName = 'PrivacySettings';

Copy link
Contributor

Choose a reason for hiding this comment

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

Missing propTypes and defaultProps

togglePrivacy = () => {
const isTracksEnabled = this.props.getOptionValue( 'disable_tracking' );
this.props.toggleTracking( isTracksEnabled );
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be reduced to

togglePrivacy = () => this.props.toggleTracking( this.props.getOptionValue( 'disable_tracking' ) );

render() {
// eslint-disable-next-line
console.log( this.props );

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe there should be a destructuring sentence assigning this.props

<SettingsGroup hasChild support="https://jetpack.com/support/privacy">
<ModuleToggle
compact
activated={ false }
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs this.props.getOptionValue to reflect the correct state

<ModuleToggle
compact
activated={ false }
toggling={ false }
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs this.props.isSavingAnyOption to toggle optimistically.

toggleTracking: ( isEnabled ) => {
return dispatch( updateSettings( { disable_tracking: isEnabled ? false : true } ) );
}
} )
Copy link
Contributor

Choose a reason for hiding this comment

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

Both mapStateToProps and mapDispatchToProps can be reduced using shorthands.

return dispatch( updateSettings( { disable_tracking: isEnabled ? false : true } ) );
}
} )
)( Privacy );
Copy link
Contributor

Choose a reason for hiding this comment

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

Privacy needs to be wrapped in moduleSettingsForm

$updated = get_option( $option ) !== $value ? update_option( $option, (bool) $value ) : true;
break;

case 'disable_tracking':
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same than above (and similar to the one below except for the !== ) so I think it's unnecessary to repeat all the code.

@eliorivero eliorivero dismissed their stale review March 8, 2018 17:10

Issues addressed.

@eliorivero
Copy link
Contributor

Added links to privacy policy and privacy blog.

captura de pantalla 2018-03-08 a la s 14 32 51

@pesieminski @nicoleckohler can you articulate some text for the two lines that have a link? It can have any length.

@eliorivero
Copy link
Contributor

@bubel @nicoleckohler

We need a page talking about privacy at https://jetpack.com/support/privacy

@bubel
Copy link
Contributor

bubel commented Mar 8, 2018

Just to confirm - I assume this is a page that will inform folks on updating their privacy settings in the UI, correct? I want to make sure we get the context correct.

@eliorivero
Copy link
Contributor

@bubel yes, that's the general idea. I guess @pesieminski can give you more details.

@ghost ghost removed the [Status] In Progress label Mar 9, 2018
@eliorivero eliorivero added the [Status] Needs Review This PR is ready for review. label Mar 9, 2018
@pesieminski
Copy link
Contributor

Yes, we're creating some new privacy options in Jetpack (opt out for tracking) and more transparency/privacy docs. This is a place for them to live - both info and functionality.

break;

case 'jetpack_event_tracking':
jetpack_require_lib( 'class.jetpack-user-event-tracking' );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is throwing a fatal, can't find the lib

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, because of #9003

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. While coding this today, I extracted the class to make the updates so it works with it. We will merge this after Enej and Miguel merge the other.

@pesieminski
Copy link
Contributor

For the beginning:

We are committed to your privacy and security.
Read about how Jetpack uses your data in Automattic Privacy Policy and What Data Does Jetpack Sync?

For the end:
See more WordPress privacy information and resources on privacy.blog.

@eliorivero
Copy link
Contributor

Added PR description and most up to date screenshot:

captura de pantalla 2018-03-09 a la s 20 01 36

@bubel
Copy link
Contributor

bubel commented Mar 13, 2018

I've started working on the jetpack.com support page.

@bperson
Copy link

bperson commented Mar 13, 2018

👋 No idea if you're still using w.js as a Tracks library from JS, but there should be a setOptOut command that will pop out in there and block any pixel going through it. It could be used when the opt out status is being changed ( 38-gh-analytics )

onClick={ this.trackPrivacyClick }
href="https://automattic.com/privacy/"
target="_blank"
href="#/privacy"
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this link doesn't work from this list of all modules page:
/wp-admin/admin.php?page=jetpack_modules

2018-03-16_08-59-54

Copy link
Contributor

@eliorivero eliorivero Mar 16, 2018

Choose a reason for hiding this comment

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

Good catch @jaswrks!

Since this is the JS-version of Jetpack settings page, I think we'll want to add a new JS-free admin page that contains the texts and links plus a checkbox and submit button to disable tracking.

I'm inclined to leave this PR specifically for the JS settings page and address the issue in a new PR. We still need to have #9003 merged. Thoughts @dereksmart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, let's take that on in another PR

@jaswrks
Copy link
Contributor

jaswrks commented Mar 16, 2018

@bperson writes...

a setOptOut command that will pop out in there and block any pixel going through it. It could be used when the opt out status is being changed ( 38-gh-analytics )

What if a user lost that cookie? The Tracks library from JS would then be out of sync with their preference in usermeta, no?

What if, in addition to the cookie, we set a JS global opt-out flag that is based on the user's current preference. 38-gh-analytics could then be updated to check for that too.

@bperson
Copy link

bperson commented Mar 19, 2018

What if a user lost that cookie? The Tracks library from JS would then be out of sync with their preference in usermeta, no?

The main point is that it will block pixels requests to ever be fired, thus saving bandwidth both for the users and us :) ( + the user doesn't have to take our word for it that we aren't tracking him if there is no tracking pixels being fired ;) ). I still expect us to have a "last resort" opt-out filter in the back-end.

What if, in addition to the cookie, we set a JS global opt-out flag that is based on the user's current preference. 38-gh-analytics could then be updated to check for that too.

You mean including something like:

<script>
TRACKS_OPT_OUT = <?php echo is_user_opted_out(); ?>
</script>

I'd rather we keep with the current "usage" of w.js and have something like this, but you're right, it could be used on every page and not only on the ones where the status changes. ( for instance in Calypso, I'm trying to set it each time the user syncs his user settings )

<script>
window._tkq = window._tkq || [];
window._tkq.push( [ 'setOptOut', <?php echo is_user_opted_out(); ?> ] );
</script>

@jaswrks
Copy link
Contributor

jaswrks commented Mar 19, 2018

The main point is that it will block pixels requests to ever be fired, thus saving bandwidth both for the users and us :)

I see. Makes sense. Thank you.

@jaswrks
Copy link
Contributor

jaswrks commented Mar 20, 2018

I'm working to hook this new privacy option up to the setOptOut command in #9085

@eliorivero
Copy link
Contributor

Rebased #9003 on this branch now that it's merged.

@dereksmart
Copy link
Contributor Author

dereksmart commented Mar 23, 2018

So this all works well, but I think we could also put some checks here in the client code from preventing these events from sending at all.

We could do something like if (Jetpack_User_Event_Tracking::is_disabled($current_user)) return; here in the PHP Tracks library https://github.com/Automattic/jetpack/blob/branch-5.9/_inc/lib/tracks/class.tracks-client.php#L56

And still sync the meta value back to .com to do whatever blocks we need there.

@dereksmart
Copy link
Contributor Author

dereksmart commented Mar 23, 2018

[edit] : I see this w.js is already being discussed above

Could also block from enqueuing w.js here https://github.com/Automattic/jetpack/blob/branch-5.9/_inc/lib/admin-pages/class.jetpack-react-page.php#L202

@dereksmart
Copy link
Contributor Author

WRT to my last comments, let's do that in a separate PR. We can block these events from the server as it is.

@dereksmart dereksmart 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 26, 2018
Copy link
Contributor

@oskosk oskosk left a comment

Choose a reason for hiding this comment

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

LGTM!

@zinigor zinigor merged commit 4d6e28b into master Mar 26, 2018
@zinigor zinigor deleted the add/privacy-page branch March 26, 2018 14:46
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Mar 26, 2018
@oskosk oskosk modified the milestones: GDPR Compliant, 6.0 Mar 26, 2018
oskosk added a commit that referenced this pull request Mar 26, 2018
dereksmart pushed a commit that referenced this pull request Mar 27, 2018
* Changelog 6.0: create base for changelog.

* Add #8938 to changelog

* Add #8962 to changelog

* Add #8974 to changelog

* Add #8975 to changelog

* Add #8978 to changelog

* Add #8867 to changelog

* Add #8937 to changelog

* Add #8961 to changelog

* Add #8855 to changelog

* Add #8944 to changelog

* Add #8973 to changelog

* Add #8977 to changelog

* Add #8979 to changelog

* Add #8980 to changelog

* Add #8982 to changelog

* Add #8983 to changelog

* Add #8984 to changelog

* Add #8986 to changelog

* Add #9005 to changelog

* Add #9010 to changelog

* Add #9012 to changelog

* Add #9021 to changelog

* Add #9022 to changelog

* Add #9056 to changelog

* Add #9061 to changelog

* Add #9079 to changelog

* Add #9080 to changelog

* Add #9088 to changelog

* Add #9096 to changelog

* Add #9097 to changelog

* Add #9100 to changelog

* Add #9107 to changelog

* Add #8969 to changelog

* Add #8993 to changelog

* Add #9003 to changelog

* Add #9031 to changelog

* Add #8945 to changelog

* Add #9052 to changelog

* Add #9058 to changelog

* Add #9066 to changelog

* Add #9076 to changelog

* Add #9053 to changelog

* Add #9108 to changelog

* Add #9135 to changelog

* Add #9148 to changelog

* Add #9125 to changelog

* Add #9137 to changelog

* Added testing instructions for 6.0.

* Added IS testing instructions, huge props to @tiagonoronha.

* Added #8498 to changelog.

* Added #8954 to changelog.

* Added #8985 to changelog.

* add #9027

* add #9112 to changelog

* add #9136 to changelog

* add #9102 to changelog

* add #9093 to changelog

* add #9062 to changelog

* add #9172 to changelog
@rickybanister
Copy link

A few minor tweaks please:

image

Note the language changes, there are a few of them. I also moved the final paragraph above the setting so it was easier to see it. I also removed the end margin from the setting toggle as well as the period at the end of the label.

Text:

The Jetpack team is committed to your privacy and security.

Read about how Jetpack uses your data in the Automattic Privacy Policy and our "What Data Does Jetpack Sync?" document. You can also find more WordPress privacy information and resources on privacy.blog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.