displaying own like count next to like button - facebook

I have a website where the URLs have some tracking parameters that do not affect the page that is displayed i.e. the URL is of the form http://mywebsite.com/page1?tracking1=aaa&tracking2=bbb and 'tracking1' and 'tracking2' are just tracking parameters used for some other purpose and do no determine the page that is displayed. The page that is displayed is always 'http://mywebsite.com/page1' irrespective of the values of these tracking parameters.
I have included the facebook like button on my website pages and facebook treats each of these URLs, including the tracking parameters, as separate pages. I'm not able to get facebook to ignore these tracking parameters and just consider the URL without tracking parameters as a page. So, I'm storing my own like count against the actual URL (when I get a callback on the like action) and displaying it next to the like button.
Is displaying own like count next to facebook like button against their usage policy? Is there a better way to do this?

Is there any particular functional reason you're using GET (ie URL) variables to store your tracking?
If you can push them into POST instead, or use cookies or sessions for your tracking, you can simplify your URLs and Facebook should treat it as a single page.
If you have to use GET due to, for example, the links coming from external websites, you could use a pass-through URL to do your tracking, before forwarding to the main page. ie someone clicks the link to redirect?tracking1=aaa&tracking2=bbb&page=page1
And redirect, as you may have guessed, does what you need to do with your tracking before forwarding the user on to page1.

Related

How to send a Facebook page as url using the Facebook send button?

I will try to explain a bit the context for my problem.
Context:
A while ago I started working on Facebook application. One of the requirements is to be included in a Facebook page as a tab. This application will contain on a page a send button in order to be able to make it more engaging with specific people, users of the application would choose on their own. The reason behind this is because the Facebook page containing the application is related to alcohol, and "liking" the application will get more audition and potential children. Another reason for using send button rather then other similar options from Facebook (like send dialog etc.) is because in Facebook documentation was stated that send button works on mobile devices and other options don't.
Problem:
My problem is related to the send button. What I need is to be able to completely configure the send button: url, image, title, description. I have research the open graph tags in order to be able to do this. Everything works fine if the page I want to be sent with the message is a website OUTSIDE Facebook. Once I started to use the url of a Facebook page (let's call it www.facebook.com/mycustompage), then the crawler takes the images, title, description from facebook.com ignoring the actual page and the produced message is not what I want.
I have searched a lot to better understand this limitation and could not find anything relevant.
The only article I could find as a potential solution was (and even this I had trouble finding):
Send button returning error codes, like button works fine
The above discussion is a workaround which I have already put in place but is not 100% what I want. The described workaround is about putting in the send button:
<div class="fb-send" data-href="http://www.mycustomdomain.com/og"></div>
a page that sniffs the user agent. In case the user agent is Facebook crawler to serve an html empty page just with the open graph tags, otherwise redirect to the desired URL - which in our case is the facebook page www.facebook.com/mycustompage.
The message produced contains:
the title which is a link to www.mycustomdomain.com/og which when
clicked opens a page in a new tab with the address
www.facebook.com/mycustompage - this is relatively ok
under the title I have a "sub-title" readonly text containing the domain of the link: www.mycustomdomain.com - THIS IS NOT OK since I don't want to share where I have hosted the application.
the image and the desired description - this is ok.
Conclusion:
What I want to know if there is a better way to do this rather than this workaround.
If not I would like to know how I can hide for the produced message the "sub-title" so that the hosted domain is not visible.

Facebook Like Button with hash

when i try to add to my website a FB Like Button with url+hash (example.com/#TEST)
and i try to click the like button - it shares the link without the hash in the news feed (example.com).
when i try to setup the button with "%23" instand of "#" (example.com/%23TEST) - it counts each hash separately in the count box.
is there any way to put a like button with hash - and still count the url without the hash?
Thanks!
When you are creating Facebook like buttons, Facebook uses cURL (correct me people) to acces your URL that has metadata. So if cURL sees different metadata, per URL, you will get different LIKE buttons.
But this doesn't happen; as on the server side, Facebook sees the same URL for every dynamic # enabled link. Since the part of the link before # is same. JavaScript (or any Behavior that can create a hash in URL) is ignored, obviously, since its Behaviour is a client only thing.
The best possible way would be to create the Button dynamically using JavaScript and change the URL-to-like of each button to something friendly without hash.
abc.com/def#part1
abc.com/def#part2
// to
abc.com/def/part1
abc.com/def/part2
Only for the curl script to see it as a different URL.
And when the user hits that link - abc.com/def/part1 - you would be needing server side help as well to redirect to the view part1 from the route def. So you would, in your router code, load only upto the route def (imagine MVC) and then ask the controller to load the view part1, with JavaScript enabled to append the URL hash #part1.
These hash tags are for client side actions not server side. You will not be able to use them in your Like Button.

How to get the Facebook iFrame Tab url (including parameters) from within the app?

I think there are a few similar questions that seem to suggest using app_data in the signed request (http://developers.facebook.com/docs/authentication/signed_request/) but I'm not sure if it will be possible to do what I am trying to achieve with it as I've never used it before.
If I have my Facebook 'Tab' Url as follows:
http://www.facebook.com/pages/PAGE_TITLE/PAGE_ID?sk=app_APP_ID
What I want to do is add an extra parameter on the end as follows:
&WT.mc_id=email-uk-8014
The reason for this is for tracking purposes and links will be sent out of the form
http://www.facebook.com/pages/PAGE_TITLE/PAGE_ID?sk=app_APP_ID&WT.mc_id=email-uk-8014
and the extra parameter will allow us to track the campaign id.
As you can see I have no way of knowing the value of the parameter beforehand as it depends on the link clicked by the user so is it possible to somehow get the value of the WT.mc_id parameter inside my iframe app?
app_data is the only parameter passed through other than the page ID and user's basic details (locale and if they do/don't like the page) - you'll need to use that for any sort of campaign tracking (or link elsewhere and redirect to the tab after capturing your analytics data)
you can pass get variables in facebook but only in canvas application
you just have to use $_REQUEST['xxx'] to retrieve the data.
you should not pass the param in href of facebook. Instead just make linking inside your app so that you can track the events. As you will be in iframe and having complete control you can do same on your own site.

What's the difference between a PageMod/page-mod and a Page/page-worker?

I don't understand the difference. The only difference I can see is that a PageMod uses a match pattern, whereas a Page uses a specific URL. Why not just use a PageMod (more versatile) for everything?
The page-mod module works with pages that the user loads in the browser. The page-worker module lets you load a web page in the background and perform some operations with it. So you would for example use page-mod if you want to add a "Super-Dooper-Search" button to all Google Search pages when the user visits them. But you would use page-worker if you want to load the Google Search page in background when the user clicks some button, extract the search results from it and present the results to the user - without the user ever seeing the page you loaded (just as an example, don't actually do that because it violates Google's ToS).

Where a redirect is coming from?

I am making a website, where a person could be redirected to a form page several different pages within the site and depending on where they were redirected from, the form would be filled out certain to make it quick for them. This is all on the mobile, so data has to be kept in mind.
That information is usually contained in the HTTP Referer header field.
You can get this data from the headers sent by the browser (referrer URL) - usually these are stored as "Server variables"
However, I would recommend staying clear of this method as it can introduce a few other problems. I would recommend using session/cookies to keep track of the last page the user has visited.