开发者

Track Facebook Like Conversion directly on Fan Page

开发者 https://www.devze.com 2023-04-03 10:27 出处:网络
is there a way to place a tracking pixel to tell if a user converted to a fan when the like the fan page when they are on the fan page (not on an external site)?

is there a way to place a tracking pixel to tell if a user converted to a fan when the like the fan page when they are on the fan page (not on an external site)?

In this situation they would be directed directly to a fan page where if they clicked the like button we would could this as a conversion. Someone mentioned with the old Static FBML app you may be able to do this but now this if gone. We're looking for t开发者_开发百科he easiest solution but can go as deeply technical if needed.

thanks


You can subscribe to edge.create to see if they clicked an XFBML Like button, or you can parse the signed request to see if they've already liked the page.

Neither of these measure what you want though.

If you need to track conversions from the Like button outside your tab's iFrame, you'll have to do the following:

  1. Parse the signed request to see if the current user likes the current page.
  2. If they don't, set a cookie called impression or something.
  3. If they do, check for the cookie. If the cookie is there, you've got a conversion.
  4. Don't forget to delete the cookie, or you'll register a conversion every time they return.

Signed request docs here

https://developers.facebook.com/docs/authentication/signed_request/

$signed_request['page']['liked'] is the value of interest.


You can use an Event.subscribe for clicking the like button:

FB.Event.subscribe('edge.create', function(href) {
    // Do something, e.g. track the click on the "Like" button here
    alert('You just liked ' + href);
});

The function will be executed every time the user clicks a Like button.

In the callback function you will have the href of the like button and if neccery you can check to make sure that is the right like button.

You can use also: edge.remove for unliking the page.

Here is the official FB documentation: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/


You can tell if someone is a fan of the page in a Tab app by inspecting the Signed Request "page" property. Details on the signed request here: https://developers.facebook.com/docs/authentication/signed_request/ This was also available in FBML which people may have been referring to.

Just to clarify, how are you sending the user to the Fan page? If you are sending them to the page via a Facebook ad then the Ad insights will give you information on how many users who clicked on the Page ad ended up liking the page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号