Can google analytic API provide all info of all pages of a website? - google-analytics-api

I am new to Google Analytics. I would like to get all information (Unique and Total Visitors, Redirecting URL etc) of a Profile, which has url like www.someurl.com/profile/unique_profile_id
So I can easily have unique url for each profile, but as I am new to this. I don't know where to start.
API docs is good but confused where to start. If some can suggest small source of getting started with what i mentioned it will be very helpful.
Thanks in advance.
I come up with this query, but still I am not understanding ga:ids. This ga:id is for my home page www.mydomain.com
https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A90283827&start-date=30daysAgo&end-date=yesterday&metrics=ga%3Apageviews%2Cga%3AuniquePageviews
Let's suppose my site have 1000 user and their profile has url as I mentioned above. So what will be ids for that each profile to query.

I think you are miss understanding how the Google Analytics API works. The api returns raw data back from Google Analytics in the form of Json. It will be up to you to format that data.
What I want is that how can I access data of each page that is
currently available in my site.
I sugest you look at ga:pagepath by adding this dimension you will be able to request data by the page. for example pagepath, sessions will give you the number of sessions by the page path. You may want to try testing using the query explorer so that you can get back only the data you need.

Related

How to get instagram user data (ex follow count) through facebook.com api with http request

I want to get instagram user data for example follow and follows count using http request to https://graph.facebook.com/v14.0/{inst_acc_id} but i cant understand which token from graph api explorer i should use. There is lots of types and lots of permissions there. i tried different ones and all of them doesn't work for me. Or maybe there is another easier way to get instagram user data after the 2020 api change.
I need a solution for my NodeJs project, but it would be great to make it work even in plain http in postman. Any advices are highly apreciated)
So after the 2020 update you don't have an easy way to get even public data from meta ( facebook and insta). To get access for their api you need to provide a lot of personal data about your business, your website and a lot of other documents for them to review your request. And if you are trying to have a simple website that shows for example your instagram followers count its a giant overkill. And no other way around.

Fetching and displaying linkedin company updates on my page

I am building a laravel project, in which I wish to fetch articles from my company page on linkedin and display them there.
However, before I can consume the API, it requires me to log in as a linkedin user.
How can I get the articles without logging in?
For a nice and good workaround you should use the API, and yes you need an account for that. There are other options, they can be very slow and isn't very stable. In that case, you need to open with PHP al the content from an URL and walk through every div and use that data on your own wat.
More information about that (PHP, XPATH);
Retrieve the contents of a div from external site (PHP, XPATH)?
I hope this is relevant to your question and helps you.

Facebook Graph API insights

I'm new on working with Facebook and honestly I found it very confusing, terminology and documentation seems to be very ambiguous in many cases. Can somebody please help me out with a plain english explanation on how I can achive the following?
Post and image to Facebook (on the user page) and then check the stats (insights) of that post.
Till now I have managed to:
1) Create an app
2) Post the image on the user page with the desired message
I'm not able to understand how I can retrieve information about the particular image which was uploaded through my app. I want to know how many people have viewed that image, how many likes did it get, how many times it was re-shared.
Is it possible at all?
I'm posting to /photo not too /feed and I will like to keep it this way if it is possible.
Sorry if this was answered already but I spent a few hours trying to find an appropriate answer but wasn't able to get the right documentation.
UPDATE 1
After having a couple of days off from this topic and receiving the first 2 answers, I took another dive into this. Now I have tried the Graph API Explorer as suggested, and using the ID of a POST I can get some details about the POST, but the insights aren't showing anything, just next and previous.
My goal is to be able to gatther some stats about the pictures uploaded through the app. If this is not possible directly what should be the approach I need to take?
I don't believe a personal /photo has /insights attached to it - the Insights Object documentation page suggests that they do not - but you should be able to get likes, shares, and comments via the API.
It would appear FB has launched a redesign/reorganization of its documentation in the last couple of weeks, but the documentation for the /photo graph object is here -- you will need the user's Access Token, and the API endpoints you're looking for each have links to their own documentation pages there, including example code for each type of request.
Edit (summarizing discussion in comments):
There is no method via the Facebook API to gather insights for all photos posted to individual user timelines via an app. The app can gather likes, shares, and comments for each of those objects individually via API requests, and can make API requests for insights for photos posted to its own timeline. Neither of those options solves the intended use case here.
I'd recommend a solution that uses Sharing rather than an app integration, as this allows for better access to insights on the photos being shared. This is also a much simpler integration, and less brittle wrt future Platform changes. The main tradeoff is that the original photos being shared are expected to expire after a couple of months -- if this is unavoidable, I'd suggest implementing a redirect for requests for expired objects on the site.
We are able to get different kind of photos or picture Using Graph API
like as below:
1.Page Photos
Photos for a Facebook Page.A Page Access Token is required for all methods.Find here
2.Page Picture
Picture belonging to a Facebook Page. Find here
3.Photo
Represents an individual photo on Facebook. Find here
4.User Photos
Photos for a person.Find here
I hope it's helps you.

How to get Facebook share count for all links shared using a given application via Facebook API

Is it possible to get a list of statistics/analytics for all the links shared using a server-side Facebook application via the Facebook API?
I have a list of links that can be shared to Facebook using the appId defined in my server app. In order to refresh the share count of those items, I'm currently calling:
http://graph.facebook.com/{MY_URL}
whenever I want to update those values.
Obviously, this solution is not very scalable, because the number of items constantly grows so I can't call the method on all the URLs in sequence. Alternatively, this information can be fetched every time it needs to be visualized to the users. However, this can mean that the same request will be made to Facebook API in quick succession even though the chances of anything changing are small.
Ideally, I would like to get a list of all the links/items shared using my application with the share count for each of them. This way I can do a nightly update of all the values without going one by one.
I'm using the
me/links
API method to share the links to Facebook.
Analytics of a post, shared by a page can be accessed by the Insights API
Below id the Graph API call to access the count of clicks sent to your domain by a certain post.
/v2.4/<object-id>/insights/domain_feed_clicks?period=lifetime
If this is not what you're looking for, please refer to the permalink mentioned above and find the metric which best suits your need.
I would like to get a list of all the links/items shared using my application
The API does not provide that kind of list.
To reduce the number of API requests you have to make, you can request the data for several URLs in one go though: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#multirequests
https://graph.facebook.com/?ids=http://example.com/foo,http://example.com/bar,…
(You should properly URL-encode any URLs you use a parameter values here of course.)

Facebook Graph API - How to get everything I have liked?

I am new to the API. I tried /me/likes in the graph explorer, it returns only the pages that I like (rightfully so according to the api reference). However, I'd like to get everything - namely posts, photos, statuses, etc - that I have liked.
Any insight?
I do not believe it is possible to get what you are asking for with the Graph API. A good way to see what query to use to get data is to first look at the website and mobile apps to see if they present the data you want. This is because the website and mobile apps will use the Graph API or FQL to retrieve data when it is available through those sources. So all you would need to do is go to the page that contains data that you want and then using a network traffic capture tool (like Fiddler) you can see what requests are being made to get the data.
It turns out that there is a page on the website that displays all of the objects that a User has Liked. To see this, select "Activity Log" in the drop down on the right-most side of the FB toolbar. Then select "Likes" from the left side column. This view will display the data that you are looking for. Unfortunately, to get this data the app makes a request to:
https://www.facebook.com/123456/allactivity?privacy_source=activity_log&log_filter=likes
Where "123456" is the FB UserId. What is returned is an HTML page and not JSON.
As the answer to this question has pointed out, it will take multiple Graph API AND FQL queries just to retrieve the objects that are in your Activity Log. You would then need to spin through those to determine if it is something you Liked or not.