Empty story clicks statistics in Facebook application insights - php

Posting stories via php facebook application using such construction :
$facebook->api('/'.$wall_id.'/feed',
'post',
array(
'access_token' => $access_token,
'message' => $message,
'picture' => $picture,
'caption' => $caption,
'link' => $link
)
);
There are "702 Stories Published" in app insights ( Apps->My application->Insights->Stream Publish ). But there are no Story Impressions or Story Clicks at all. (702 - 0 - 0)
Is it a bug, or do I need to pass some additional parameters to FB api to track these clicks?

How much time has passed since the stories have been first posted? Facebook Insights requires at least three days to update its data.
Let's wait, and we'll see if this is a bug. I don't know about any special parameter to enable tracking: it should be available without any configuration.

Related

facebook PHP SDK posting as activity, not post

I hope you will be able to help me.
I'm developing an app, and I'm willing to post an activity (that appears on user timeline in recent activity) everytime the user use my application.
Although, for the moment, I have this code below, and it only posts a normal link :
if($can_post){
$facebook->api('/'.$uid.'/feed', 'post', array(
'message' => '',
'name' => 'Name',
'caption' => 'Caption',
'description' => 'SDesc',
'picture' => 'picture url',
'link' => 'link',
'actions' => array(array('name' => 'catch phrase',
'link' => 'http://link'))
));
Check out this guide on posting "stories" to the user's timeline using the Open Graph API, so maybe it's this functionality that you need. The example they give is just a like, but it can be easily modified.
Be aware that Facebook will have to approve you app again if you want to use stories (see end of page on link above).
It's also worth noting that Facebook have also defined a wide range of predefined "Actions" to help in the process, so it's a good idea to check to see if your app falls into one of these categories.

Facebook Graph Api posting on friends wall

I'm having a problem when trying to post a link to a friends wall using the Facebook graph from my application.
I am currently using the Facebook SDK for PHP, I have no problems posting to the wall of the user that's logged in but cannot post to friends of the logged in user.
I have requested the extended permission "publish_stream" and here is the code am I using:
$args = array('message' => $message,
'link' => 'google.com',
'name' => 'Test!',
'caption' => 'Please click on the link',
'description' => 'description');
$result = $facebook->api("/$friendId/feed", 'POST', $args );
$friendId has the facebook id of the friend of the logged in user, any help would be much appreciated.
A quick scan of the FB API reference shows that you can set the to key value pair in this operation to
mention or target a user in this post

How to post on group wall?

First, what I have:
I have an FB app which is able to get a user's access_token and post on user's wall using FB API in PHP.
Can anyone please help me to 1) post on my all groups wall using a batch request (or any other technique) and 2) how to get my all groups id?
If I use my app to post on my all groups (100+) wall, is it ok with FB?
Does FB treat this as spam ?
Thanks
i have created a facebook application 1 month back, called WooTube
To promote my application free,i joined around of 100 Groups to promote my fb video app in various of interest base like "KPOP,SNSD,SUPER JUNIOR,Just For Laught and etc" with my application build in features "Post To My Group".It is writen using fb.api
https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-ash4/383568_191076937694203_922285357_n.jpg
Unfortunately this is spam...i was blocked from facebook for 2 days due to spamming.The reason is i shared the same link for around 30-40 time in less then 5-10 minutes.
what i would like to suggest is:
Do not share the same link for more then 20 times per day (to be safe)
Do not post too frequence, each post should have a space of 10 second.
Don't used your own account for spamming (you know what i talking about :) )
You can use Facebook batch API to post to multiple wall (groups, pages or friends wall).
The basic method to do it is shown below. The IDs can be User IDs, group IDs or Page IDs.
You can read more about it at: http://25labs.com/tutorial-post-to-multiple-facebook-wall-or-timeline-in-one-go-using-graph-api-batch-request/
$batchPost[] = array(
'method' => 'POST',
'relative_url' => "/{ID1}/feed",
'body' => http_build_query($body) );
$batchPost[] = array(
'method' => 'POST',
'relative_url' => "/{ID2}/feed",
'body' => http_build_query($body) );
$batchPost[] = array(
'method' => 'POST',
'relative_url' => "/{ID3}/feed",
'body' => http_build_query($body) );
$multiPostResponse = $facebook->api('?batch='.urlencode(json_encode($batchPost)), 'POST');

Update facebook status using php

I know it's a very old question.But i really bound to ask the same question again.How can i update my status using PHP?Because i find several solutions in google and stackoverflow but non of that currently works.May be the cause of facebook up gradation process or anything else.
I chk:
1) http://360percents.com/posts/php-curl-status-update-working-example-sep-2010/
2) http://www.barattalo.it/2010/03/01/php-curl-bot-to-update-facebook-status/
But unfortunately non of the solution is working.So, is their any kind heart who can help me to update the facebook status using php easily?i shall be very much glud if anybody pls give any working solution. Regards---riad
Well, I've wrote a tutorial about posting to the user's wall: How To: Post A Message On The User Wall Using Facebook Graph API.
$args = array(
'message' => 'Hello from my App!',
'link' => 'http://www.masteringapi.com/',
'caption' => 'Visit MasteringAPI.com For Facebook API Tutorials!'
);
$post_id = $facebook->api("/me/feed", "post", $args);
Notes:
I'm using the PHP-SDK
You need the publish_stream permission
Check out this answer
What about checking directly the Facebook API ?
http://developers.facebook.com/docs/
Check the "Graph API"
The Graph API is the core of Facebook Platform, enabling you to read and write data to Facebook. It provides a simple and consistent view of the social graph, uniformly representing objects (like people, photos, events, and pages) and the connections between them (friendships, likes, and photo tags).
I wrote this code im my blog completely pl check that in the following link
http://scriptime.blogspot.in/2012/12/facebook-status-updates-using-php-sdk.html
here i am giving samll code
$status = $_POST['status'];
$facebook_id = $userdata['id'];
$params = array(
'access_token' => $access_token,
'message' => $status
);
$url = "https://graph.facebook.com/$facebook_id/feed";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_VERBOSE => true
));

Using the Facebook PHP SDK to post from Group

I'd like to use the Facebook PHP SDK to post on a user's wall FROM a group (i.e. not as a Status Update, from the user via an external app, but from a group via an external app). I'm having a difficult time finding docs on the topic, and would like a code example as well as any information regarding any restrictions (e.g. can a group post on one's wall if the user does not belong to the group).
I've tried using the 'from' parameter, like this:
$attachment = array(
'access_token' => $access_token,
'message' => "Message from the group",
'name' => "Name of the Post",
'from' => array(
'name' => "Sender's Name",
'id' => "#############"
),
'link' => "http://myurl.com/",
'description' => "Description of the Posting",
'picture'=>"http://myurl.com/mylogo.png",
);
$ret_code=$facebook->api('/'.$fb_id.'/feed', 'POST', $attachment);
While posting as a "Page" is totally possible by getting a page access_token, I've never seen anything similar for Facebook groups. So I would assume that this is NOT possible.

Categories