How can I get google adwords performance data for keyword campaigns split by keyword? - google-ads-api

I'm trying to retrieve the individual keyword/query performance report from adwords using the google adwords api across all of our campaigns, but at the moment when I run my query I'm only getting results for queries from our shopping campaigns and I'm confused as to why that would be. The report_query I'm using is as follows
report_query = (
'SELECT AdGroupId, AdGroupName, Keyword, AdGroupStatus, CampaignName, Clicks, Impressions, Cost, Query '
'FROM SEARCH_QUERY_PERFORMANCE_REPORT '
'DURING 20180520,20180522');
f = open('H:/eCommerce/Business Team/Brad Davis/python/google_keyword_performance.csv', 'wb')
report_downloader.DownloadReportWithAwql(
report_query, 'CSV',f, skip_report_header=False,
skip_column_header=False, skip_report_summary=True,
include_zero_impressions=True)
Does anyone have any insights into why this might be? Thank you for your help.
Brad

You might try adding a where clause for the ad network. Here's how it's done in PHP.
->where('AdNetworkType1')->equalTo('SEARCH')

The problem was that I had the incorrect account id (or more correctly, I was given the incorrect account id by multiple people before one of them came back to me and corrected it) associated with the .yaml file loaded with the authorization information. Once I fixed that, everything worked.

Related

What's the most efficient way to query Microsoft Graph events by id list?

Currently, in my code, I am taking a list of stored Event ids and fetching them like this:
results = await Task.WhenAll(
criteria.Identifiers
.Skip(offset).Take(pageSize)
.Select(i => userEvents[i].Request(options).GetAsync())
.ToList());
This works fine, but it makes pageSize number of calls to the API, which seems less than ideal. Is there a way to bundle these identifiers into a single API call?
My question proved similar to another:
Getting multiple users/groups by objectids
The answer, there, suggests this feature might be coming, but isn't here, yet. If anyone knows more about the timeline, please add another answer or comment.

Issue finding results in Microsoft Graph /me/drive/search endpoint

I'm having a hard time figuring out how the /me/drive/search endpoint matches documents.
When I try /v1.0/me/drive/search(q='myQuery') I receive documents with the name myQuery back. This makes sense. What doesn't make sense is that if try /v1.0/me/drive/search(q='.') I receive a giant list of results from across my organization. It appears that these documents are accessible to me, but when I try to search for one of them by name they don't come up.
Example
/v1.0/me/drive/search(q='.') returns many documents, one of which is named "My Test Document"
/v1.0/me/drive/search(q='My Test Document') returns no results.
One would expect that the 2nd query returns the same document as the first query.
We've made a change that we believe should help for this specific query. Hopefully you'll get consistent results now!

Nested Jira Search on two independent projects

I need to get a nested Jira search. I am okay with JQL query but I have a usecase that I don't know how to solve
Company uses project=XTBOW for reporting purpose for executives (Epic)
The company also uses project=XTA for underling development work (Task)
The XTA task are linked to the XTBOW Epic for a subset of task, but not all. (There is a large body of XTA task that are not linked to XTBOW)
I need to get a filter going for all XTA projects that are linked to XTBOW Epics only. I would like to use a filter like this:
project = XTA and "Epic Link" in (<project = XTBOW.key>)
I can manually prove this filter works. But need a way to automate this filter, because the number of tickets being created/tracked in growing exponentially, and if someone deletes a key for XTBOW that is in the "Epic Link" field, the JQL search throws and error because the "Key" is missing.
Example - FYI cf[10231] is the "Epic Link" field:
project in (XTA,XTWOF) and cf[10231] in (XTBOW-42,XTBOW-59)
The overall objective is to download the data to a dataframe. So if there is a better suggestion to even avoid JQL and do it through python. I am all ears. Just need so pointers to start. I am just going this route because I have already built a JIRA-Downloader/Parser using Python.
The easiest way to get subsets of issues is with:
search_issues(jql_str, startAt=0, maxResults=50, validate_query=True, fields=None, expand=None, json_result=None)
You should be able to just pull the issue sets using the queries you already created, just make them into strings.
DOC

google adwords api: how to get adgroupId in Keyword/Ad?

Based on code examples on google website I am able to fetch keywords and ads. The example prints something like this:
printf("Text ad with headline '%s' and id '%s' was found.\n", $googleAd->ad->headline, $googleAd->ad->id);
based on such field list which was fetched:
$selector->fields = array('Headline', 'Id')
Is it possible to get adGroupId as well ? I have been looking at documentation for TextAd, however I cannot see adGroupId in field list. I am afraid it is not possible, because adgroup has field called campaignId. Any help?
Yes, it is possible to get adgroup id. It is part of AdGroupAd type, and can be retrieved using "AdGroupId" as selector name. Then you would retrieve the field as $googleAd->adGroupId. More details here:
http://code.google.com/apis/adwords/docs/reference/latest/AdGroupAdService.AdGroupAd.html
In the future, I recommend that you ask the questions on the official AdWords API forum at http://code.google.com/apis/adwords/community/. The forum is pretty active, and AdWords API team members regularly answer developer questions on the forum.

Can't parse new google urls - HTTP_REFERER doesn't contain parameters anymore

It seems a little odd to my, but although everybody knows about the new google search urls (see Google using # instead of search? in URL. Why?) no one has a problem with the HTTP_REFERER.
I'm using the referrer to parse the google string for the searchquery (&q= ) but as this is all in a hash-tag it wont be sent to the server and all i get is "http://www.google.de/".
So do you know a way of getting the query the user searched for, befor landing on my site?
Due to late-2011 Google security changes, this is no longer possible when the search was performed by a signed-in Google user. See:
http://googleblog.blogspot.com/2011/10/making-search-more-secure.html
http://analytics.blogspot.com/2011/10/making-search-more-secure-accessing.html
Since there are multiple q's in the query string you have to match the "q" parameter globally and take the last one:
/[?|&|#]q=([^&|^#]+)/ig
Get rid of "site:" searches (there are others, but I haven't done them)
/[\+|?|&]?site:([^&|^#])+/g, '');
Then parse the results.
/[\w^'\(\)\{\}]+|"[^"]+"/g
This has been working well for me.

Resources