Hi Google Ads Team,
I was trying to fetch a report using google ads API search stream. But
unfortunately API always returns with 10ki records only. As per my
understanding after reading the documentation "*SearchStream*" doesn't need
to mention *page_size *param.
Please help me to resolve this. Below are my code the way I am doing.
*GoogleAdsServiceClient googleAdsServiceClient
=client.GetService(Services.V10.GoogleAdsService); // Create a
query that retrieves campaigns. string query = @"SELECT
campaign.id, campaign.name, ad_group.id, metrics.cost_micros,
group_placement_view.display_name,group_placement_view.target_url,
metrics.average_cost, metrics.average_cpc, metrics.average_cpe,
metrics.average_cpm, metrics.conversions, metrics.clicks, segments.date
FROM group_placement_view WHERE segments.date BETWEEN '2022-02-01' AND
'2022-03-15'"; // Issues a search request.
googleAdsServiceClient.SearchStream("XXXXXXX", query,
delegate (SearchGoogleAdsStreamResponse response) {
if (response.Results.Count() == 0) {
Console.WriteLine("No results found!");
Console.ReadLine(); return; }
CsvFile csvFile = new CsvFile(); //
Set the header for the CSV file.
csvFile.Headers.AddRange(response.FieldMask.Paths); //
Iterate over all returned rows and extract the information.
foreach (GoogleAdsRow googleAdsRow in response.Results)
{ csvFile.Records.Add(new string[]
{
googleAdsRow.Campaign.Id.ToString(),
googleAdsRow.Campaign.Name,
googleAdsRow.AdGroup.Id.ToString(),
googleAdsRow.Metrics.CostMicros.ToString(),
googleAdsRow.GroupPlacementView.DisplayName.ToString(),
googleAdsRow.GroupPlacementView.TargetUrl.ToString(),
googleAdsRow.Metrics.AverageCost.ToString(),
googleAdsRow.Metrics.AverageCpc.ToString(),
googleAdsRow.Metrics.AverageCpe.ToString(),
googleAdsRow.Metrics.AverageCpm.ToString(),
googleAdsRow.Metrics.Conversions.ToString(),
googleAdsRow.Metrics.Clicks.ToString(),
googleAdsRow.Segments.Date }); }
if (outputFilePath == null) {
outputFilePath =
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) +
Path.DirectorySeparatorChar +
GetType().Name +
DateTime.Now.ToString("-yyyyMMMMdd-HHmmss") + ".csv"; }
else if (!outputFilePath.EndsWith(".csv"))
{ outputFilePath += ".csv";
} // Create the file with the specified path, write all
lines, and close it. csvFile.Write(outputFilePath);
Console.WriteLine( $"Successfully
wrote {response.Results.Count()} entries to {outputFilePath}.");
Console.ReadLine(); } );*
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/2e67688e-4140-47b7-a6c2-911026952a4bn%40googlegroups.com.