WordPress-Android icon indicating copy to clipboard operation
WordPress-Android copied to clipboard

Stats: tapping the site title on the blog details screen generates one view in stats when it should not

Open designsimply opened this issue 5 years ago • 6 comments

Steps to reproduce:

  1. Delete and reinstall the app (use a fresh install).
  2. Go to My Site and select a site if prompted.
    Note that it's helpful to test with a site that gets little or no traffic.
  3. Tap the site title at the top to open a webview.
  4. Go to Site Pages and tap View for some of the pages.
  5. Go to Blog Posts and tap View for some of the posts.
  6. Wait a few minutes (up to 30).
  7. Check stats to see if any views were recorded.

Result: opening a web view by tapping on the site title on the Blog Details screen generates a single view in stats for the home page when it should not. Views for blog posts or pages from the Posts List and Pages List via the app did not generate any stats. Also, the home page view is only counted once, even if the site title is tapped to open a webview several times.

Note: I am not sure whether it matters for webviews but I made sure I was logged out of WordPress.com in the web browser on my device before testing. I also noticed that logging out and back in or closing and reopening the app didn't affect that one single view was recorded, but if I deleted and reinstalled the app then I could generate one more view each time I repeated the testing steps.

Screenshot_20191023-174449 Screenshot_20191023-182322 Tested with WPAndroid 13.4 on Pixel 3 Android 10.

/hat tip @charliescheer for the report (internal reference: p4a5px-2qf-p2)

designsimply avatar Oct 24 '19 00:10 designsimply

@malinajirka: @hafizrahman is looking into this. I wonder if you have some insights or ideas for why this happens?

shiki avatar Oct 30 '19 12:10 shiki

Hmm, not much comes to my mind. When the user clicks on the title, we open an internal webview and we log the user in. So I'd assume the server won't record any stats events since the server knows we are logged in. 🤷‍♂ Only thing I remember is that when you click on "View" on posts/pages list, "preview=true" query parameter is attached to the url. Maybe that's what makes the difference?

malinajirka avatar Oct 30 '19 12:10 malinajirka

I tested it this way:

  1. Have a test site and make sure it's public (since visits to private sites are recorded),
  2. Add a menu to my test site that goes to wp-admin.
  3. Start a fresh install on an Android emulator.
  4. Log in to account, select the test site.
  5. Tap site title/address.
  6. Webview is loaded, opening the site.
  7. Select the wp-admin menu item that was added to the site.

In my test, I was able to go to the wp-admin area without being asked to log in.

The logic flow for the tap site title action looks like this, it's a bit huge:

wp android - understanding issue 10675

What matters here is that as far as I can check, the action does call the correct function to load the webview using proper authentication, so that the user is already logged in when the site is loaded. The test above also confirms that the auth/login works properly.

So what I'm not sure about now is why it's still recorded as a visit, even though it is correctly a logged-in admin visit to the site's home page 🤔

hafizrahman avatar Oct 30 '19 13:10 hafizrahman

This was also reported by the user in 2744961-zen, who noticed their views are logged if they navigate to My Site → View Site. They're on version 14.1 of the Android app and use Firefox.

I was able to replicate by following the steps that Sheri initially laid out, but viewing my site via My Site → View Site (rather than viewing a specific post or page). I'm on a Pixel 3, using alpha-210, and Chrome's my default browser (note, I'm also logged in to WordPress.com in my mobile browser).

SiobhyB avatar Feb 27 '20 14:02 SiobhyB

~Another report in 3415661-zen, using Google Pixel (not specifying the actual model), Android 11 and WPAndroid version 15.8.1.~ (EDITED: The report in the ticket isn't related to this issue but I was able to replicate the steps in the original thread)

Able to replicate this on OPPO Reno 4, Android 10, WPAndroid version 15.9-rc-2.

reginabally avatar Oct 19 '20 01:10 reginabally

This is still an issue in 20.6-rc-2, reproduced on Samsung Galaxy S21.

thehenrybyrd avatar Aug 30 '22 15:08 thehenrybyrd

Another report in 7104118-zen.

Reproduced on Nexus 5X (Android emulator), Android 13, App version 23.3.1.

reginabally avatar Oct 16 '23 02:10 reginabally

7789929-zen User would like to be notified when a fix is released.

ariel-maidana avatar Mar 18 '24 14:03 ariel-maidana

This opens up in a WebView, not something to fix in the app. See also #10653, and https://github.com/wordpress-mobile/gutenberg-mobile/issues/1387

ravishanker avatar Apr 05 '24 01:04 ravishanker