How to love / share URLs inside Facebook containing get-parameters

We are working on a facebook application with many dynamic pages. Since the application is embedded in a tab on the facebook page, the URLs contain a get parameter to address the correct tab / application. We want to implement the like and send buttons for multiple pages in our application, but facebook seems to reset all get parameters from the urls in facebook. As a result, all the like and send buttons point to the facebook page, not the tab.

Does anyone have any workarounds? We have already tried redirecting through the external sefor facebook urls only.rver, but facebook seems to evaluate the links when the like // send button is clicked (and seems to perform all kinds of redirects).

UPDATE:
Here is an example of a problematic URL:
https://www.facebook.com/smartmobil.de?sk=app_171502639574871

UPDATE:
The problem does not seem to depend on url input options. This button does not seem to work with any URL starting at www.facebook.com

When used in a similar button, is everything behind? will be reset. This seems to happen only for facebook urls.

+6
source share
3 answers

The best workaround so far is to point similar buttons to external (non-facebook) URLs.

To do this, you need to do some conditional redirects to get the user back to your canvas URL. You can use client side javascript redirects:

<script> window.location = 'http://apps.facebook.com/yourcanvasname/foo/bar'; </script> 

Or you can redirect the server side based on the useragent string. Basically, if useragent contains "facebookexternalhit", then render the main HTML page containing OG tags, if not, redirect the URL to the canvas.

Doing this means that the sharecraper / linter on Facebook will not follow redirects to the canvas URL, but any user who comes to your URL will return to Canvas.

+5
source

I am also looking for a solution to manage the contents of a user page tab using the get parameter (app_data). I still don't have a solution, but at least here is the reason all links to www.facebook.com go out of get parameters. Here at the beginning, the developer explains why.

+1
source

Unfortunately, I do not think that what you are trying to do is possible. To publish such programs, you must specify a Facebook content identifier or alias. This will not work for you, because tabs that do not seem to have an open content identifier, but instead use a page content identifier with an additional parameter that you cannot use with the graph.

It is forbidden to use external links and other content that does not have an identifier programmatically. With an external URL, the first, for example, an unrecognized URL, creates a new Facebook page for those who like to be presented (which is the problem that I refused to try to battle), but presumably your page id is an alias (www.facebook. com / smartmobil.de) in the url makes Facebook select your page, not create a new one.

The only suggestion I can think about this late at night is to aim for an external URL that redirects via Javascript and not on the server, but Facebook might be wise too and I'm afraid that I will go to sleep and not test his:)

0
source

Source: https://habr.com/ru/post/893381/


All Articles