Repeat Visitor: register new block and assets#11224
Conversation
|
D23649-code. (newly created revision) |
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 5, 2019. |
96606dc to
7df525c
Compare
|
🎉 I just wonder if we should have something that removes the cookie from the users. Or stops the counter at a reasonable maximum ? 100 hits? Also do you know if we we need to update our GDRP documentation when we ship this feature? |
Yes, I think we'll need to mention the cookie in the support doc for that block. |
jeherve
left a comment
There was a problem hiding this comment.
I'd have a few minor remarks (see below), as well as 2 small things that confused me when trying the block:
- It seems the block visibility is not affected when you are logged in to your WordPress account; I kept seeing the block even though I had visited the page multiple times. As soon as I logged out, the block disappeared. I understand why because I could see the cookie value, but I think site owners may be confused by this behaviour, and expect:
- To see a banner telling them that since they are logged in, they can always see the block.
- The counter should only increment when you are logged out. This would allow me to really test the block; I would log out and refresh the page 3 times to make sure my block is working. If we want to increment the counter regardless of whether you are logged in or not, I think we should use the banner I mention in "1" to show the current counter status.
- It wasn't clear to me that the counter was meant as a "more or equal" or "less or equal". Maybe we should update the wording to make that clearer?
|
jsnmoon, Your synced wpcom patch D23649-code has been updated. |
Currently, the cookie value is set to expire after 6 months as seen here. Do you think we should consider a shorter max cookie age? (I'm a little lukewarm on the idea of setting a max limit for the visit counter, given that I don't really have a good gauge for what a reasonable maximum might be.)
Absolutely agreed. I went ahead and posted internally for privacy guidance here: p4H3ND-NR. |
This behavior is a bit bizarre, given that we don't have specific handling for logged-in users. As currently implemented, block visibility should be unaffected by the authentication state of the viewer. At any rate, I can see how always showing the block to the author could be helpful. Do we have any Gutenblocks that provide this kind of differentiated experience for authors viewing their own post(s)?
The phrasing for the counter was actually from the editorial team... Nonetheless, I can see how it might confuse our users. |
jeherve
left a comment
There was a problem hiding this comment.
Quick note about the cookie's name, as we discussed earlier.
Also fix phpcs warnings.
33f8174 to
2409f8c
Compare
jeherve
left a comment
There was a problem hiding this comment.
This is looking good and tests well now. Merging here and on WordPress.com; that should make testing easier.
|
Thank you for your help getting this shipped @jeherve! 🚢 |
* Initial Changelog for 7.2 * Testing list: add mention of IE11 testing * Initial Changelog for 7.2 * Testing list: add mention of IE11 testing * Add CL for #11224 * Add CL for #11426 * Add CL for #11442 * Add testing instructions for #11224 * Add CL for #11451 * Reclassify CL item * Add testing instructions for #11451 * Add CL for #11486 * Add CL for #11418 * Add CL for #11524 * Add CL and testing instructions for #11449 * Add CL for #11460 * Add CL for #11520 and #11582 * Add CL for #11531 * Add CL #11644 * Add testing instructions for #11644 * Add testing instructions for #11644 * Add CL for #11618 * Uniform changelog lines * CL #11679 * CL #11661 * CL #11654 * CL #11645 * CL #11643 * CL #11636 * CL #11635 and for other PHPCS commits * CL #11627 * CL #11626 * CL #11598 * CL #11596 * Remove nested items for shortcopy. I don't believe the detailed list is helpful * CL #11570 * CL #11569 * CL #11560 * CL #11558 * CL #11555 * CL #6704 * CL #11298 * CL #11324 * CL #11443 * CL #11484 * CL #11516 * CL #11529 * Expand Ads block enhancement CL item
Changes proposed in this Pull Request:
This change adds a new "Repeat Visitor" block that controls its Inner Block visibility based on how often a visitor has viewed the page. It can be configured to show its content either above or below a certain view count threshold.
The corresponding wp-calypso PR is here.
Testing instructions:
Spin up a Jurassic Ninja instance.
Connect Jetpack to your WPCOM account.
Navigate to Settings->Jetpack Constants, check JETPACK_BETA_BLOCKS, and Save.
Add the Visited block to a post or page. Nest whatever block within the Visited block.
Save a post and open it.
Check the cookie value for
jp-visit-counter; it should have incremented from0to1.Refresh the page multiple times and ensure that the
jp-visit-countercontinues to increment. Ensure that your content becomes visible after it crosses the minimum view threshold (and vice versa for maximum view threshold).Proposed changelog entry for your changes: