I am going around in circles a bit with this one trying to find a solution online and I cant find one so I thought I would ask then it may be useful to others as well.
The scenario.
With PHP I am looking to talk back to the Google Adwords API. OK not a biggy. However I want to tie it in with our own back office system to marry up data from sales/conversions to impressions/clicks/costs of each campaign/adgroup in Google Adwords.
This would involve tagging the destination URLs I initially thought with the dynamic tag from Google of {creative} for example http://www.mydomain.com/productone/?adid={creative} however this appears to be a number which is not unique across the account but unique only under Adgroup. So AdgroupOne and AdgroupTwo could both have an adid of 1,2,3,4,5 etc.. Therefore you cannot use this id to pull the data.
Has anyone else encountered this? Is there a way of getting around it to get a unique indentifier which can be stored in the backoffice with each visit to trace back to Google Adwords via their API?
Really appreciate the help with this one as its got me stumped. Thanks guys.
The easiest way to fix this would be to provide your own ids in the url. Also maintain a map at your end, of the form (adgroupid, adId, your_tag_id). This way you can lookup the map to figure out what Ad was clicked when a url is hit.
Some id rules to keep in mind:
campaignId: Unique across system.
adGroupId: Unique across system.
adId: Unique within an adGroupId, so (adGroupId, adId) is unique across the system.
keywordId: Unique within an adGroupId, so (adGroupId, keywordId) is unique across the system.
Cheers,
Anash
Related
I would like to know if is there any possible way to show the total number of users of a specific country in my webpage. As far as I found, you can not get it through API.
I'm guessing you really want the total number of users on facebook who have 'liked' or used facebooks oauth to connected with your site.
Do you use graph api in your site? I'm pretty sure you can query by country name--as long as the user's who have shared that info with you have provided it.
Check this out... http://developers.facebook.com/docs/reference/api/
And this: http://developers.facebook.com/docs/reference/api/insights/
From their site
Facebook Insights provides the ability to see geographic and
demographic data for people that have Liked a Page or installed an
app. Location data is based on the geographic location of each person
as determined by their browser IP address and is limited to the top 20
countries and cities. All other demographic information is aggregated
and non-personally identifiable.
Generic searches can be done like this:
https://graph.facebook.com/search?type=location&place=166793820034304
Where the place id is the id for whatever you want to search on.
https://graph.facebook.com/search?type=location&place=166793820034304
Disclamer: This method is not supported by Facebook. Use it at your own risk. I take no responsibility whatsoever.
Go to: https://www.facebook.com/ads/manage/adscreator/
Fill in the ad info with something random (eg. google.com as the url)
In the next part you'll notice a dynamic reach estimation that changes depending on the parameters you select, including country. Try changing the country and observe the network activity with for instance the developers tools of Google Chrome.
Call the ajax url that returns the json data with the proper parameters programatically, this should be easy to figure out in the previous step.
Collect and store the json data for your evil deeds.
???
PROFIT!
The actual ajax call and parameters change from time to time, which is why I didn't include them directly, but it should be easy enough to figure it all out. Also note that they are estimates, even if they come from Facebook, they don't count every single user every time an advertiser sets up an ad — it's the best estimate you can possibly get though.
This method as I mentioned is neither official nor supported by Facebook, but sites like socialbakers.com or checkfacebook.com have been using them for ages. (There, I revealed the secret)
I've been tearing through the Facebook API documentation and beginner-level tutorials on the basics of an in-Facebook app and am starting to get a grasp of the basics. I'm looking to develop an app for a semester-long project for school and was wondering if anyone might be able to point me in the right direction of what documentation/tutorials to look for. To give some further context, here is the basic idea behind the app:
It will allow users to fill out basic drop-down form filters (Friends lists, date ranges, post types, etc.) and then press a button to 'stumble' to a random existing post (i.e. a random picture from 2 years ago, a random status or wall post from 3 months ago, etc.)
I was thinking of maybe looking further into FQL, but would just like to get some advice before proceeding.
Thanks in advance!
I have yet to find a way to do a stem search via the Graph other than from the http://graph.facebook.com/search? link. See: http://developers.facebook.com/docs/reference/api/ and look for the search section.
I want to update a no_comments row in a database exactly when a facebook comment on my site is made. I would like to do the same thing for likes as well.
I can imagine setting up a cron job that uses the graph API to periodically retrieve the number of comments and likes and update the database but for a large number of objects that are associated with comments the lag introduced is undesirable.
I am not looking for someone to "code a solution" for me...rather can someone point me in the right direction: is it possible to use AJAX to somehow update the database at the point when a comment is made or a like is done?
I can see how one can use the click event for the like button but it's not fool proof...
All help is appreciated!
Assuming you are using Oauth and have a facebook application then I would consult the facebook API docs for events or triggers. If a method exists it will be in the API docs.
Your description of your "site" is vague so it is hard to understand what your site or how it connects to facebook.
Edit:
I wish people would explain down votes. I can't fix it if I don't know what the issue was.
I followed my own advice and searched for this "facebook run script when like is clicked" on Google and found this: enter link description here This is almost the same question except it deals with "like" buttons rather than comments.
You can generate "events" like I had previously suggested. So further consultation of the FB API may be the most fruitful way of finding out if there are events around "comments" as well as "likes".
Maybe the OP knows this, but there are several APIs (last time I checked) to facebook including Javascript methods that could be used in an Ajax manner. However, without further details of their website implementation there is no way to tell.
I've seen there is some other discussion about this, however, none of the other threads I've read have targetted my situation.
For one, I do not need to get any Tweets from Twitter. I only need to send to Twitter.
For another, I don't need to have multiple accounts or different Twitter users. I can already ensure the page will only be seen by the one authorized user, so I can save any necessary login information in one configuration file and be done.
I am only posting occasionally from one web site, to one Twitter feed, and only one user will be logged onto the the web site that will send the tweet.
I am hoping to find a simple tutorial or script that can allow me to cut to the bare bones and just send tweets to my Twitter account.
However, all the tutorials and scripts I've seen so far have been too elaborate, handling logins, sessions, authenticating multiple users, and so on.
Is there any way I can get simple oAuth PHP code to accomplish what I'm describing?
This would help
http://code.google.com/p/dabr/source/browse/trunk/common/twitter.php
http://code.google.com/p/dabr/source/browse/trunk/common/OAuth.php
This should help or at least point you in the right direction.
https://dev.twitter.com/docs/twitter-libraries#php
You can use ZF component
get accessToken only once, keep it as serialized string anywhere
http://framework.zend.com/manual/en/zend.service.twitter.html
I'm working on a foursquare integration for a social good website, and I have everything working as I want it to, however I want to retrieve and store users foursquare user_id's so others can search for their friend. I've been searching all day, but I can't seem to find an end point, am I missing something? Or does this has to be done through user search? What is then best to use, as I have their email, and full name.
I am using jmathai's foursquare-async php libary. I think it should be easy but I just can't figure it out.
I've found the solution. To get an users' details you should use the end point "users/self". I had tried this before but got an error message. I think that was related to something else now.
After authenticating two lines are simply enough:
<?php
$fsObj->get("/users/self");
print_r($creds->response);
?php>
This gives an json array containing all relevant information on the user, including last checkins, name, and id. 'self' can here also be replaced by any user id you're authorized for on that moment.
For more information I'd recommend to visit Foursquare Api website