What are the parts of google adwords url? - php

I need to automatically generate url to the existing advertisement in google adwords. I've got a link like this:
https://adwords.google.com/cm/CampaignMgmt?authuser=1&__u=%param_one%&__c=%param_two%#c.%param_three%.create&app=cm
I do not know what are those params one, two, and three. I do not know where can I get them and what is their role in an address. But I'd like to! In fact I just need to generate a URL to click on it and appear on an ad page. How can that be done? May be their lib provides a method to generate url like this?

Unfortunately that's not possible, at least not in a reliable way (see also this rather old post from the Adwords API forum).
The structure itself is not hard to parse:
Inside the query string, __u is your user account's ID while __c refers to the ID of the specific Adwords account. These don't appear to be in standard Adwords XXX-XXX-XXXX format, though, so you would have to either create a mapping of all your accounts or come up with the proper translation function.
The fragment refers to a specific Adwords entity, for instance; c.123 is the campaign with ID 123 while a.ABC_XYZ refers to the adgroup with ID ABC inside the campaign with ID XYZ.
But even if you manage to get the __u and __c parameters right, more often than not you will be redirected to your Adwords account's top level view.
Interestingly enough, Google Analytics introduced little buttons in the "Adwords" reporting tab a few months ago which are supposed to take you right to the correct campaign if you have access to the linked account, but even those only work half of the time, especially if your Adwords account is an MCC.

Related

How to get TicketMaster event id from event URL?

I currently have access to Ticketmaster's Discovery API. I want to take a link like this
https://www1.ticketmaster.com/zpl-jingle-jam-featuring-lizzo-why-dont-we/event/05005726960D2E82
and use the ID to get event data from Discovery API. When I tried in API explorer it said ID was wrong. I found out the ID is actually vv16AZAjJPOZACd2ad.
Is there any way to use ID from the URL to reference the given event? I see you can in partner API, but that's not easy to join from what I see.
If that's not at all possible, how are people able to create stock checkers in discord? For example: !stock 05005726960D2E82 would return stock remaining for the given event broken down by sections.
It's not possible with discovery API since that wasn't it's intended purpose.

Is there any way to get the number of FB users on a specific country?

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)

Getting the user_id through Foursquare Api V2

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

Tracking user clicks back to Google Adwords API

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

Is there an API to determine the most common link in a number of tweets?

Is there an API (Twitter API does not provide this) that I can use to determine the most common links in 200 tweets for example. What I want to do is to get the latest 200 tweets and then determine what are people talking about, I am sure that the tweets will contain links (because I will ask the twitter API to return tweets that contain links only) but I will also want to make sure that my code will understand that Two URLs are the same even if they have different bit.ly links.
What I am trying to do (this might make it easier for your guys to provide some help) is that i am trying to determine what is the most important subject people are talking about in these 200 tweets. I understand that people might be talking about the same story but provide different links, however, i am not sure if there is an easy way to understand that.
Links to examples, APIs, sample code, and any other ideas will be helpful :)
If you need more information to explain this please tell me and I will edit the question to include more information
Not that I know of, but you can accomplish this by..
Find all of the links in the list of tweets using a regex pattern.
Use the twitter search api to search for each link. The number of results is returned.
Manually sort the links by # of results returned.
Fundamentally you can get this from the api, first get the latest public timeline (this will be 100 tweets, if you need 200 then you need to request a cursor and create a loop that checks if the next_cursor value is greater than 0) and then build a spider that determines relevancy.
http://api.twitter.com/1/statuses/public_timeline.???
where ??? is json, xml, rss or atom
If you want to determine the popularity of words then dump all the text into a string and then split it on spaces, punctuation etc, discard non-nouns, sort it and create a dictionary variable with the words and the count of the words.
If you want to determine the popularity of links then it is the same process but with an extra step to do a web request on each link to determine the ultimate link destination.
Building on what others say, you can use twitter search to get the tweets no problem and I wont go into that part in this answer.
A possible route for the short links:
You could, for example, goto bit.ly and create a custom short link for the url you are wanting to keep track of. Using that link if you add a + to the end of the url you will get link stats. example: http://bit.ly/tweelay+ Additionally, bit.ly keeps track of other short links that point to the same url. Which you could then use in your searches.
using bit.ly /stats API you can get a list of the shorten urls.
depending on the urls you are trying to keep track of you may have access to referral logs. (i.e. your own website) Using your referral log you may also be able to find additional short urls that you can use to search.

Categories