Geo stats and Ads/Campaign stats comparison in Google Ads - google-ads-api

I am trying to build a report that shows metrics such as clicks, impressions and costs per targeted location from Google Ads.
I compare these numbers with Campaigns stats and it does not match. I got lower number from Geo stats actually. On the other hand, in google Ads application, the numbers are the same.
(When I compare Ads stats with Campaing stats, it is matching for 100 %)
Would you know how what I am doing wrong? How the query from geo stats should look to match with Campaign stats?
Thanks for help.
select sum(Clicks)
FROM `ct-gtm.Google_Ads_Manager_Account.CampaignBasicStats` as stats
where stats.Date between '2022-10-01' and '2022-10-31'
select sum(Clicks)
from `ct-gtm.Google_Ads_Manager_Account.GeoStats_3749539878` as stats
where stats.Date between '2022-10-01' and '2022-10-31'
and IsTargetingLocation = true
I would expect the same numbers but geo stats result is smaller.

Related

How can I load EBITDA and TotalEquity for ticker in GoogleSpreadsheet?

I have a GoogleSpreadsheet showing me super data about price, high and low. But currently, I check manually EBITDA and Total Equity before to buy.
Is there an approach to load this data to Google Spreadsheet automatically? Currently even =GoogleFinance("KMI", "netassets") does not work -- returns #N/A

How to get video metrics for each video for each day

I am trying to get video metrics for each video under my channel using Java SDK.
videoMetrics = analytics.reports()
.query("channel==" + channelId, video_start_date, video_end_date, "views,comments,likes,dislikes,estimatedMinutesWatched")
.setDimensions("day")
.setSort("-estimatedMinutesWatched")
.setFilters("video==" + videoId)
.setFilters("country==US")
.execute();
This request not providing the metrics for each video on a particular day. Can anyone suggest the issue and solution in the code.
You're looking for reports.query.
The YouTube Analytics
API's
reports.query method lets you retrieve many different Analytics
reports. Each request uses query parameters to specify a channel ID or
content owner, a start date, an end date, and at least one metric. You
can also provide additional query parameters, such as dimensions,
filters, or sorting instructions.
Metrics are individual measurements of user activity, such as video
views or ratings (likes and dislikes). Dimensions are common criteria
that are used to aggregate data, such as the date on which the user
activity occurred or the country where the users were located. Filters
are dimension values that specify the data that will be retrieved. For
example, you could retrieve data for a specific country, a specific
video, or a group of videos.

Campaigns Performance Report wont include campaigns with zero impressions

I have an application that gets its data from our Google Adwords account.
Particularly, It gets the list of ad campaigns along with their results (number of clicks, cost, etc...). The problem is that, in spite of the google API definition specification say that:
"The Campaigns Performance report includes all statistics aggregated
by default at the campaign level, one row per campaign".
I'm only getting the campaigns which have non-zero value in their columns (For example, has been displayed al least one time).
Do you have any idea of **how to include all the campaigns in the report, even when its values are
Thanks a lot.
EDIT: It happened when the campaigns had exactly 0 impressions.
I have finally found a way to get it:
// Report Creation
$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = 'Adgroup performance report';
$reportDefinition->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'CSV';
// Exclude criteria that haven't recieved any impressions over the date range.
$reportDefinition->includeZeroImpressions = TRUE;
The last line specifies that also must be included Campaigns with zero impressions. By default it's value is false, set it to true and you'll get all the info.

YouTube Analytics API - Demographics Minimum Views Seem to Be Required for Query

I've been working with the demographics queries available in the YouTube Analytics API and was hoping you could shed some light on the following situation:
If I ask for demographics for a channel for a day where the channel
had around 2000 views or less, I get no rows returned.
If I ask for 3 such days in separate queries, I still get no demographic data
returned.
But if I ask for all 3 days in a single query that spans the days, I do get demographic data
So it seems like there's an imposed minimum number of views that a query needs to cover before demographic data will be returned by the API, even when other methods show there is some demog data avilable. Am I understanding this correctly? Is the API supposed to behave this way?
[Update: I originally stated that the Analytics dashboard was not matching the API on thi, when in fact they return the same results, so I've updated the title and the description.]
I can confirm that this is the intended behavior of both the API and the YouTube Analytics web interface.
This makes sense from a statistical point of view. Most statistics have a margin of error, a bigger sample helps reduce this. If there isn't enough data the analytics wouldn't be accurate. It would be possible to show those analytics (for smaller numbers) if they also included their margin of errors, but if the margin of error is too high the data would be useless. However, it should be possible to extrapolate the data for day "N" using the demographics for (N-3,N) and (N-3,N-1) and total views for those ranges (plus for day "N") (considering there is demographic data the ranges) by subtracting the demographics of the 3day range from the 4day range.
For example (assuming 10k views/day), if the 4day range has 75% green viewers out of 40,000 you have 30,000 green (lizard-people) viewers in the past 4 days. If the 3day (3 days right before day "N") range has 87.5% green viewers out of 30,000 total, you have 26,250 green viewers in that range. By subtracting, 4day-range from 3day-range you're left with 3,750 green viewers for day "N", and since day "N" has 10k views, that means 37.5% of those views are from green lizard-people.
It should work, but I wouldn't trust that data to have a reliable margin of error. (please don't use this if it's for something important)

Collecting follower/friend Ids of large number of users - Twitter4j

I'm working on a research project which analyses closure patterns in social networks.
Part of my requirement is to collect followers and following IDs of thousands of users under scrutiny.
I have a problem with rate limit exceeding 350 requests/hour.
With just 4-5 requests my limit is exceeding - ie, when the number of followers I collected exceeds the 350 mark.
ie, if I have 7 members each having 50 followers, then when I collect the follower details of just 7 members, my rate exceeds.(7*50 = 350).
I found a related question in stackoverflow here - What is the most effective way to get a list of followers using Twitter4j?
The resolution mentioned there was to use lookupUsers(long[] ids) method which will return a list of User objects... But I find no way in the API to find the screen names of friends/followers of a particular "User" object. Am I missing something here.. Is there a way to collect friends/followers of thousands of users effectively?
(Right now, I'm using standard code - Oauth authentication(to achieve 350 request/hour) followed by a call to twitter.getFollowersIDs)
It's fairly straightforward to do this with a limited number of API calls.
It can be done with two API calls.
Let's say you want to get all my followers
https://api.twitter.com/1/followers/ids.json?screen_name=edent
That will return up to 5,000 user IDs.
You do not need 5,000 calls to look them up!
You simply post those IDs to users/lookup
You will then get back the full profile of all the users following me - including screen name.

Resources