Page MenuHomePhabricator

Improve text scraped by Facebook from donatewiki
Closed, ResolvedPublic

Description

Three donors so far today have reported that FB can't determine their country.

(split the other sharing issue out to T152195)

Details

Related Gerrit Patches:
mediawiki/extensions/FundraiserLandingPage : masterIgnore invalid country codes from query string

Event Timeline

MBeat33 created this task.Nov 30 2016, 7:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 30 2016, 7:02 PM

I've been trying the debugger at https://developers.facebook.com/tools/debug/sharing/. Facebook's scraper evidently doesn't have a defined location, so the country is getting set to XX. That's causing the message we set for T151411 to show up.

Any idea how we can have Facebook not cache the link with country=XX in?

Ejegg added a subscriber: Ejegg.Dec 1 2016, 7:43 PM

Let's update Special:FundraiserRedirector to use the GeoIP cookie when the country code on the URL is invalid - it currently ignores the cookie if there's any country param in the querystring.

Change 324789 had a related patch set uploaded (by Ejegg):
Ignore invalid country codes from query string

https://gerrit.wikimedia.org/r/324789

That sounds like a great idea, thanks @Ejegg !

Pcoombe renamed this task from Thank You page to Facebook error to Improve text scraped by Facebook from donatewiki.Dec 2 2016, 11:17 AM
Pcoombe triaged this task as High priority.
Pcoombe updated the task description. (Show Details)

I successfully posted a few days ago. I'm posting the expeced result below [1]. Also props to whoever setup the url for the link back[2]. That's super helpful for tracking.

I've never seen a geolocation bug on an FB post. I understand that one can set the specific text and images for the post. Is our bug an i18n issue? If so, will the url change for that user as well?

If we get this fixed, how difficult will it be to adjust the image or text? We might want to run this by comms and adjust copy and art for the current campaing.

[1]

[2]
https://donate.wikimedia.org/w/index.php?title=Special:FundraiserLandingPage&country=US&uselang=en&utm_medium=SocialMedia&utm_source=Facebook&utm_campaign=ThankYouPage

@DStrine

The problem is that Facebook scrapes links, and caches what it finds to show in previews. When no country is specified in the URL, Facebook's scraper geolocates to 'XX' so is seeing the message we added for T151411. Then it uses that message in the preview for everyone. I don't really want to remove that message completely since it is an issue for some donors.

It works fine when sharing a link with the country specified in the URL. However we don't want people to do this, as their friends might be in other countries.

Additionally trying to tweak these previews is a case of trial-and-error. Facebook really want everyone to be using Open Graph tags, which we can't do since we have no way to edit the page <head>. Their scraper can generate previews without those tags which is how we do it at the moment, but the behaviour is undocumented and unpredictable.

Ejegg added a comment.Dec 2 2016, 3:47 PM

Ah, I misunderstood the problem. So maybe we need to change the logic that shows the "can't find your country" message to take navigator.userAgent into account?

Okay, I've made the https://donate.wikimedia.org/?country=XX page have the same appeal content as a normal donation page, moving the error into the form. Forced re-scraping of https://donate.wikimedia.org/ and the URL on the Thank You page, and it seems to have done the trick. Preview content is back to what it was previously.

Pcoombe closed this task as Resolved.Dec 2 2016, 4:10 PM
TJones removed a subscriber: TJones.Dec 5 2016, 6:08 PM
mmodell removed a subscriber: awight.Jun 22 2017, 9:34 PM

Change 324789 merged by jenkins-bot:
[mediawiki/extensions/FundraiserLandingPage@master] Ignore invalid country codes from query string

https://gerrit.wikimedia.org/r/324789