How can I show users Google analytics data, on my website? - google-analytics-api

I have a SEO website, and want to show google analytics data of users.
I can retrieve my own website google analytics data via google Reporting API version 4 php client , but how can I retrieve others Google analytics data ? Users after registration gives only theirs email and tracked website url, what else I need to make php client request ?
How can I do it ?

To show the Google analytical data. You have to add the website url into your Google analytical account.
You must be the owner of your account. Add as many websites as you wanted
to add the website of users.
You have to follow the steps as you added your website.
That means user has to add the code into their website which will be provided when we add a new website in Analytical account.
Once added the data will be shown to the main account holder.
then you have to provide the access to the User whom you want to show.

Related

Facebook Messenger Platform: how to get user specific information?

I'm trying the recent released Facebook Messenger Platform and so far so good. Everything worked well and I was able to create a echo bot.
But I'm wondering how I could identify this user that started chatting in my page. For example, when a user started chatting I get a PID user (page specific user id).
Making the follow request to Facebook Graph API:
GET https://graph.facebook.com/v2.6/{PAGE_SPECIFIC_USER_ID}
I discovered that I can just ask for the following fields: first_name,last_name and profile_pic.
So my question is, how could I discover if this user is a current customer of my business page? Is there another way of querying more information (like e-mail and real facebook user id)?
Facebook has updated the messenger platform API (2016-07-01) and introduced a new feature called Account Linking. This can be used to identify a user who has created an account on your website via Facebook Login and you can link the two accounts. Facebook login has its own set of permissions which can be used to get a lot more information via Facebook graph API. You can find the complete list here.
Currently, there's no way to do this. The best way would be to prompt the user to enter their information in chat or give them a link to a mobile login page or some other way of linking their account to the chat.
Messenger Platform 2.0 introduce "ID Matching API" ,that will solve the problem.
https://developers.facebook.com/docs/messenger-platform/connecting-accounts
you can retreive a user information like below using fbmq library https://github.com/conbus/fbmq
# this method will occur when a message received from user
#page.handle_message
def message_handler(event):
user_profile = page.get_user_profile(event.sender_id)
print(user_profile) #first_name, last_name, profile_pic, gender ...

How can I verify multiple other Adsense publisher-ids on my website

I have a website with articles written by myself and others. To reward the other persons for written content for my website I would like to share the Adsense income. I'm thinking about making a standard Adsense code and let the publisher-id rotate.
Can I just use their publisher-id or should the others person verify my website somehow in their Adsense account? And may I just use multiple publisher-ids on my website?
Hopefully someone can tell me what to do. Can't it lead to a ban?
Google states "Publishers are permitted to place ad code from different AdSense accounts on the same page as long as the owner of the website has given permission for ads to be placed on their site, and the webpage complies with our program policies.
A publisher will only be credited for clicks and impressions on the ad units associated with their account. Additionally, publishers are responsible for monitoring each webpage upon which their ad code appears to ensure compliance with our policies."
Source: Google Groups
Google's policy on using your own AdSense account on another publisher's website is here: https://support.google.com/adsense/answer/1346295?hl=en. You will also need to get the publisher to add you to their ads.txt file, as described by Google here: https://support.google.com/admanager/answer/7441288?hl=en .
Below are highlights from these two sources:
Ads on the same page or site as another publisher
If a site is in compliance with our program policies and the company or owner of the site has given you permission to display ads on their site, you may place your ad code on the same page as the other publisher's ad code. You will, however, need to contact your web hosting company or the owner of the site to obtain permission to display ads on their site. Additionally, you will only be credited for clicks and impressions on the ad units associated with your account.
Keep in mind that every publisher is responsible for the content of a site on which their ad code is placed. If a site is found in violation of our policies, we will notify any publisher(s) whose ad code is on the site.
....
Authorized Digital Sellers, or ads.txt, is an IAB initiative to improve transparency in programmatic advertising. Publishers can create their own ads.txt files to identify who is authorized to sell their inventory. The files are publicly available and crawlable by buyers, third-party vendors, and exchanges.

Do I need my own user database in order to use Google & Facebook sign in?

I have a well functioning login system right now. Im in the process of implementing Google+ and Facebook login too. Its works fine. But:
When a user logs in via Facebook or Google shall I create a new user in my web apps users database? If so, what should i fill as password?
Lets say a user has logged in via Facebook and he inserts a new book in the books table. What shall I put in the creator column of the inserted row? Usually I put the user id of the logged in user which has a row in the users table.
A user doesnt have an account on my web app. He signs in for the first time using Google+. What happens to that user if he later on chooses to remove my site from his connected accounts on google? This might be related to the first question.
Thank you.
The Documentation of the both API are really great and understandable. But I could find answers to my questions.
It's technically possible to use Google+ Sign-In without data persistence. As an example, you can see client-side-only Google+ Sign-In features on the Is Too Cute demo site.
There are certain benefits to adding data persistence and managing your own set of users but there is still a ton of great functionality you can get without needing to implement a data store:
Over-the-air Android installs
Interactive Posts
Personalize the site to the user
Access Google APIs while the user is actively browsing your site.

Integrating Facebook into Google analytics

I want to add the 'Log in with Facebook' option to my website, however I'm unsure how to integrate the information gained when someone logs into my website with Facebook with my current Google Analytics.
Is it possible to link up a visit in Google Analytics with a user who has logged into the site with Facebook to enable me to see things like age, gender etc?
Any help you can give me on this would be much appreciated.
Thanks,
Ben
you may have to do this via a redirection or possibly a frame.
Google Analytics does nolt track individual users, it provides anonymized data. So at the top level, no you cannot do this. However, there are a few more things avaiable to you. One: Facebook provides facebook insights, their own tracking suite, that will give you demographic information on the users of a facebook app or fan page. You site will effectively become a facebook app when you use their user authenication, so you will be able to get insights tracking on you site. At the present moment, facebook insights and google analyitcs do not itegrate or share data. Facebook insight also provides anonymized data, so you will not be able to identify an individual through the tracking.
The final option is, now that you are tracking users through login, you can implement your own tracking info on your site to see what individual users are doing, and attempt to track their preferences.
Its also entirely legal (in the United States at least) to buy access to marketing data and use use your registered user name pool to get additional information.
If you wanted, you could set up a "funnel" in Google.
When a user logs in through Facebook, you could send them to a specific page and then track their progress from there...
http://www.google.com/support/analytics/bin/answer.py?answer=55515
So using this you could get the percentage of users who log in through Facebook... etc.
But to collect information other than that, you would have to get the correct permissions documented here eg. user_birthday (to get the user's Birthday) and query the Graph API from there, thus implementing your own tracking of users.
You can query the Graph API using the various SDKs that Facebook provide explained here.
First of all you should check out this Google document. It explains, how you set a custom unique user id via google analytics.
Further you've to send an event to google analytics (e.g. 'fb_login') via the callback function of your facebook login function.

I want to use facebook connect in my website to register, login and comment on news articles or posts made by other users

I would like to implement the following things in my website. I have done some extensive search over the internet but couldnt find and specific examples on how to implement them
I am developing this site in php using a mvc framework
Would like to have facebook registration on my website - users who have an account in facebook will get an option to use the details to register in my site, using their authentication I would pull the relavant details from their account and create a new account for them in my website. I would like to use facebook register fbml/fbjs in this case
Would like to have facebook login used to login into my site. How to use the sessions is what I would like to know?
I would like to make posts to the facebook-wall of the users registered in my site. Also if possible sent messages to them through my code whenever a new post is made to my site.
Thanks for your help.
For login and registration, you can check out http://developers.facebook.com/docs/guides/web/.
This one is for wall posts and you should be able to implement it in any language. It is given step by step.
http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/