Jon
Jon

Reputation: 1347

Facebook og:url meta tag stripping query parameters

I have an open graph meta tag on a static page that contains a query string, and each time I run it through Facebook's url linter, the query value is stripped out.

For example:

http://www.site.com/?ref=23a3as3hth456

would return

http://www.site.com/?ref

Curiously enough, it appears that if the value doesn't contain any numbers, but is a pure string, it will register. For example:

http://www.site.com/?ref=23a3as3hth456&sample=testing

would return

http://www.site.com/?ref&sample=testing

Furthermore, the actual page URL contains query string that includes the same values, and when the Linter falls back to the default page URL, those values are preserved.

Does anyone have any further information on this? I am encoding the entire URL string with urlencode(), but am still running into this problem. Are there any workarounds at all, or am I missing something?

Thanks!

Upvotes: 4

Views: 2833

Answers (1)

Jon
Jon

Reputation: 1347

The answer here turned out to be that the URL that I was requesting did not exist yet.

It appears that Facebook will attempt to retrieve that URL first to make sure it exists, and when it was unable to connect, it defaulted back to my site's root.

Upvotes: 6

Related Questions