Facebook API : feed a carousel post (multi-photos) - api

For some time now, Facebook offers a new carousel post (basic feeding with link and many pictures) similar to the carousel ads, but every picture's link lead to the same page, it's a basic publication with text, link, image...
An sample of what I need (it's french, but sample images speak for itself:
http://www.leptidigital.fr/reseaux-sociaux/comment-creer-publication-facebook-carrousel-5612/
and the result about this news :
https://www.facebook.com/leptidigital/posts/868750466554694
I've only find documentation about the carousel ads (payable) via marketing API.
Any body know if is possible with the standard API ? My research come to nothing...
Special thanks for every one !

Thanks to CBroe for the comment left explaining where to find this information.
If you look at that post in Graph API Explorer, you see that the images are in the child_attachment structure. And apparently, you can use that field when creating page posts, too
Facebook feed documentation
Here's an example in Python on how to accomplish what the documentation means:
import requests
post_data = {"access_token": "your access token",
"message": "whatever you want to say"
"link": "https://some.link"
"child_attachments": '''[
{
"link": "http://some.link",
"picture": "https://app.replypro.io/media/wb3.jpg"
},
{
"link": "http://some.link",
"picture": "https://app.replypro.io/media/wb3.jpg"
}]'''}}
requests.post("https://graph.facebook.com/v5.0/<your page id>/feed", data=post_data)

Related

Dynamicaly updating SEO data for SPA without history API

We are developping a SaaS for our customers in the shape of an SPA with VueJS.
We would like our app to appear in the google results on the search of an item. So if you search for the term "item of some brand" in google, our app is returned because you can buy that item on it. Preferably, returning the corresponding item url.
For infrastructure reasons, we cannot rely on the history API for our links in the app. So the google bot cannot crawl our links, which is obviously a bad start...
However, I came to an idea which we would like your expertise/insights on.
Since we are building some kind of webshop, would an initial JSON-LD containing an array of references to the products with their respective url work ?
Something like :
{
"#context": "http://schema.org",
"#type": "someType",
"itemsOrWhatever": [
{
"#type": "itemOrWhatever",
"name": "Some item name",
"url": "https://my.app.com/#/item/myItemId"
},
{
"#type": "itemOrWhatever",
"name": "Some item name",
"url": "https://my.app.com/#/item/myItemId"
},
{
"#type": "itemOrWhatever",
"name": "Some item name",
"url": "https://my.app.com/#/item/myItemId"
}
]
}
Would it also work if, for each page, we update the SEO tags in the page's head ? Especially the JSON-LD part ?
As Google and other SEs are eventually improving their crawling mechanism for SPAs, you can tackle few ways via Vue without History mode.
1) for dynamic <head> issue with routing, you can fixed with vue-meta to work with your title, description and other meta keywords along with your routing
2) via SSR such as NUXT (it's part of Vue and dynamic link friendly)
3) Google Webmaster/ Search Console might be your best friend to tackle/solve problems of SPAs as you could.

How to shopify storefront navigation menu get with API?

If anyone can please help me with how to retrieve the navigation menu with REST and Graphql API.
If no API is available, then how can I write a custom Navigation API?
We need to get the below data with API. see screenshot
Use this in query. it worked for me. Remember to replace "main-menu" with the header code of your site.
{
menu(handle:"main-menu"){
items{
id
tags
title
}
}
}
currently, there is no API endpoint that would allow you to access the navigation. However, seeing that the navigation in your screenshot mainly contains collections, probably it would be a good starting point for you to read those? This can actually be done via this call:
GET /admin/api/2020-01/collection_listings.json
You can find more info here:
https://shopify.dev/docs/admin-api/rest/reference/sales-channels/collectionlisting#index-2020-01
Hope this helps,
Roman

How see analytics about branch links created using mobile SDK

I am creating dynamic branch links using Android SDK
https://github.com/BranchMetrics/android-branch-deep-linking#creating-a-deep-link
These are then shared to social media
How do I track things like click events, installs etc as I do not believe they show up in the dashboard quick links view? https://dashboard.branch.io/quick-links
Is there a HTTP API I can use to interrogate all links I may have dynamically created that are part of the same campaign?
Alex from Branch.io here:
You are correct that SDK-generated links do not show up in the Quick Links view on the dashboard. Most SDK-created links are 'disposable' (in that they get used once and then regenerated the next time), so showing every link there individually would quickly overwhelm the UI. It is possible to override this on a link-by-link basis with the type parameter, as detailed here.
However, you can access the numbers in aggregate, segmented by campaign value, which I believe is what you want anyway. This is not currently available through the API, but you can see these statistics through the Sources report on the dashboard: https://dashboard.branch.io/sources
you must include a "type": 2 in your branch params
https://help.branch.io/developers-hub/docs/deep-linking-api
const branchConfig = {
"branch_key": environment.branchio.key_live,
"type": 2,
"data": {
"$marketing_title": (params.job_name ? params.job_name : ""),
}
};

Facebook SDK title, description, caption and image fields are deprecated

Upgrading the Android SDK from 4.21.1 to 4.22.0
Facebook SDK
The title, description, caption and image field of FBSDKShareLinkContent have been deprecated. Please take appropriate action to remove usage of them.
How to set Content title and description now? Can anyone suggest something to make it work.
Thanks in advance!
You can't, the Android-Sharing facebook documentation says:
When you implement sharing, your app should not pre-fill any content
to be shared. This is inconsistent with Facebook Platform Policy, see
Facebook Platform Policy, 2.3.
From Facebook Platform Policy
Don't prefill captions, comments, messages, or the user message parameter of posts with content a person or business didn’t create,
even if the person can edit or remove the content before sharing. You
may use our Share Dialogs to prefill a single hashtag in a post, but
don't prefill any content a person or business didn't create via the
API.
Answering my own question.
What I did is I just made an html page and passed the values in meta tag for the attributes "content", "description" and "title" dynamically and gave the url of html page in shareLinkContent > SetContentUrl method.
So when shared it automatically picked the values from that html page.
This Worked in my case.
Happy Coding..!

How to pass the custom title, description and Image to google plus button like facebook share button

I one of my project I am using the sharing buttons for multiple article. I need the link share urls for facebook, twitter and google plus.
To Facebook I can pass every parameter (title,image, description) to share URL. using following code
http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image;?>'
But For google plus I can pass only two parameters. (url and lang code). You can check the documentation here.
google share link api
Google itself crawl the webpage and take the title, description and image from webpage.
Problem:
I am loading content through javascript so when crawler came page web page. It is not able to collect the information.
You can find answer for you question by visiting below url:
Google+ share with custom text and thumbnail
Here is the url you could do after 3 years
https://plus.google.com/share?url=http%3A//google.com