Skip to content

Commit

Permalink
Release version 24.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AnashOommen committed Sep 21, 2018
1 parent bf15308 commit abadaed
Show file tree
Hide file tree
Showing 406 changed files with 199,141 additions and 46,975 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
24.1.0
======
AdWords:
- Added support for v201809.

Ad Manager:
- No changes.

Common:
- No changes.

24.0.0
======
AdWords:
Expand Down
101 changes: 21 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,38 @@ This project hosts the .NET client library for the various SOAP-Based Ads APIs a

## Announcements and updates

For API and client library updates and news, please follow our Google+ Ads Developers page:
https://plus.google.com/+GoogleAdsDevelopers/posts and our Google Ads Developers blog:
For API and client library updates and news, please follow our Google Ads Developers blog:
http://googleadsdeveloper.blogspot.com/.

## Getting started

1. Install your library of choice. We recommend using the following Nuget distributions:
#### AdWords API

- [Google.AdWords](https://www.nuget.org/packages/Google.AdWords/): AdWords and DoubleClick Ad
Exchange Buyer API DotNet Client Library
- [Google.AdWords](https://www.nuget.org/packages/Google.AdWords/): AdWords API DotNet Client
Library

#### Ad Manager API

- [Google.Dfp](https://www.nuget.org/packages/Google.Dfp/): Ad Manager API DotNet Client Library

You can learn more about the nuget package manager at http://www.nuget.org. For other distribution options, see the alternative distribution options below.

You can learn more about the nuget package manager at http://www.nuget.org. For other distribution
options, see the alternative distribution options below.

1. Setup your OAuth2 credentials.

The AdWords and DoubleClick for Publishers APIs use
[OAuth2](http://oauth.net/2/) as the authentication mechanism. Follow the appropriate guide below based on your use case.
The AdWords and Ad Manager APIs use
[OAuth2](http://oauth.net/2/) as the authentication mechanism. Follow the appropriate guide below
based on your use case.

**If you're accessing an API using your own credentials...**

* [Using AdWords](https://github.com/googleads/googleads-dotnet-lib/wiki/API-access-using-own-credentials-(installed-application-flow))
* [Using Ad Manager](https://github.com/googleads/googleads-dotnet-lib/wiki/API-access-using-own-credentials-(server-to-server-flow))
* [Using AdWords API](https://github.com/googleads/googleads-dotnet-lib/wiki/API-access-using-own-credentials-(installed-application-flow))
* [Using Ad Manager API](https://github.com/googleads/googleads-dotnet-lib/wiki/API-access-using-own-credentials-(server-to-server-flow))

**If you're accessing an API on behalf of clients...**

* [Developing a web application (AdWords or Ad Manager)](https://github.com/googleads/googleads-dotnet-lib/wiki/API-access-on-behalf-of-your-clients-(web-flow))
* [Developing a web application (AdWords API or Ad Manager API)](https://github.com/googleads/googleads-dotnet-lib/wiki/API-access-on-behalf-of-your-clients-(web-flow))

## Alternative distribution options

Expand Down Expand Up @@ -85,7 +86,7 @@ To run the code examples:
- Open the Properties dialog for the Examples project (Right click the Examples project of your
choice in the Solution Explorer and select the Properties option from the context menu.).
- Navigate to the Debug Tab and enter the command line options. The command line options are of
the form `version.examplename`. For instance, `v201603.AddCampaign` is the command line option to
the form `version.examplename`. For instance, `v201809.AddCampaign` is the command line option to
run `AddCampaign` example in `v201603` version of the AdWords API.
- Compile and run the Examples project.

Expand All @@ -109,80 +110,20 @@ To use the library in a new project:
AdWordsUser user = new AdWordsUser();
// Create the required service.
CampaignService service = (CampaignService) user.GetService(
AdWordsService.v201603.CampaignService);
using (CampaignService service = (CampaignService) user.GetService(
AdWordsService.v201809.CampaignService))
{
// make more calls to service class.
}
// make more calls to service class.
```
You can refer to [this wiki article](//github.com/googleads/googleads-dotnet-lib/wiki/Getting-Started) for
more details.

### Source distribution

The source distribution of the Ads API .NET Client Library consists of individual Visual Studio
projects for the client library, code examples and test cases, documentation, and support
libraries and tools for compiling and running the library. If you are interested in the
library internals you should download this distribution. There are separate downloads for
AdWords and Ad Manager APIs.

```
The contents of this distribution are as follows:
\
\examples
\adwords
- Adwords API code examples, in C# and VB.NET.
\lib
- External client libraries referenced by various projects in the source
distribution.
\src
- Client library source, provided as a Visual Studio project.
\tests
- NAnt test cases for the library, provided as a Visual Studio project
README
Visual Studio solution
ChangeLog
COPYING
```

To compile and run the project:

- Open the Visual Studio solution in Microsoft Visual Studio.
- Open `App.config` for the examples project of your choice and follow the instructions in the
file to enter required configuration values.
- Save and close `App.config`.
- Open the Properties dialog for the Examples project (Right click the Examples project in the
Solution Explorer and select the Properties option from the context menu.).
- Navigate to the Debug tab and enter the command line options. The command line options are of
the form `version.examplename`. For instance, `v201603.AddCampaign` is the command line option
to run the `AddCampaign` example for the `v201603` version of the AdWords API.
- Set the Examples project as the Startup project.
- Compile and run the Examples project.

Alternatively, each code example has a `main()` method, so you can set the appropriate code
example as the Startup object (Select the Application tab on the Examples Properties dialog and
pick the desired class from the "Startup object" dropdown.).

To run the test cases, you need to download and install the latest version of NUnit from
http://www.nunit.org/. Once you have installed NUnit, you can compile and run the test cases
as follows:

- Right click the appropriate Tests project and choose References from the context menu.
- From the references dialog, add a reference to the `nunit.framework` assembly.
- Right click theTests project and choose Properties. Navigate to the Debug tab and choose
"Start external program". Browse to the path for `nunit.exe` and pick it as the Startup
application.
- Open `App.config` for the test project and follow the instructions in the file to enter
required configuration values.
- Set the `AdWords.Tests` project as the startup project and run the project.

It is recommended that you run the test cases against a test environment. Refer to the
appropriate API documentation for details on how this may be done.

## How to enable logging

See https://github.com/googleads/googleads-dotnet-lib/wiki#logging for details.

## Miscellaneous

### Wiki
Expand Down
2 changes: 1 addition & 1 deletion examples/AdManager/CSharp/AdManager.Examples.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Ads.Common" Version="9.4.0" />
<PackageReference Include="Google.Dfp" Version="24.0.0" />
<PackageReference Include="Google.Dfp" Version="24.1.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.2" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Ads.Common" Version="9.4.0" />
<PackageReference Include="Google.Dfp" Version="24.0.0" />
<PackageReference Include="Google.Dfp" Version="24.1.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
Expand Down
2 changes: 1 addition & 1 deletion examples/AdWords/CSharp/AdWords.Examples.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Ads.Common" Version="9.4.0" />
<PackageReference Include="Google.AdWords" Version="24.0.0" />
<PackageReference Include="Google.AdWords" Version="24.1.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.2" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Ads.Common" Version="9.4.0" />
<PackageReference Include="Google.AdWords" Version="24.0.0" />
<PackageReference Include="Google.AdWords" Version="24.1.0" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ public void Run(AdWordsUser user)
@operator = Operator.ADD
};

// For whitelisted users only, uncomment two commands below as part of the
// ADD operation to invite a user to have access to an account. An email
// will be sent to that user inviting them to have access to the newly
// created account.
// operation.inviteeEmail = "[email protected]";
// operation.inviteeRole = AccessRole.ADMINISTRATIVE;

try
{
ManagedCustomerOperation[] operations = new ManagedCustomerOperation[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.Util.Reports.v201802;
using Google.Api.Ads.AdWords.v201802;

using System;
Expand Down Expand Up @@ -68,27 +69,25 @@ public void Run(AdWordsUser user)
(CampaignService) user.GetService(AdWordsService.v201802.CampaignService))
{
// Create the query.
string query = "SELECT Id, Name, Status ORDER BY Name";

int offset = 0;
int pageSize = 500;
SelectQuery query = new SelectQueryBuilder()
.Select(Campaign.Fields.Name, Campaign.Fields.Id, Campaign.Fields.Status)
.OrderByAscending(Campaign.Fields.Name)
.DefaultLimit()
.Build();

CampaignPage page = new CampaignPage();
int i = 0;

try
{
do
{
string queryWithPaging =
string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize);

// Get the campaigns.
page = campaignService.query(queryWithPaging);
page = campaignService.query(query);

// Display the results.
if (page != null && page.entries != null)
{
int i = offset;
foreach (Campaign campaign in page.entries)
{
Console.WriteLine(
Expand All @@ -99,8 +98,8 @@ public void Run(AdWordsUser user)
}
}

offset += pageSize;
} while (offset < page.totalNumEntries);
query.NextPage(page);
} while (query.HasNextPage(page));

Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.Util.Reports.v201802;
using Google.Api.Ads.AdWords.v201802;

using System;
Expand Down Expand Up @@ -71,13 +72,14 @@ public void Run(AdWordsUser user, long campaignId)
(AdGroupAdService) user.GetService(AdWordsService.v201802.AdGroupAdService))
{
// Get all the disapproved ads for this campaign.
string query =
string.Format(
"SELECT Id, PolicySummary WHERE CampaignId = {0} and " +
"CombinedApprovalStatus = DISAPPROVED ORDER BY Id", campaignId);

int offset = 0;
int pageSize = 500;
SelectQuery query = new SelectQueryBuilder()
.Select(Ad.Fields.Id, AdGroupAd.Fields.PolicySummary)
.Where(AdGroup.Fields.CampaignId).Equals(campaignId)
.Where(AdGroupAdPolicySummary.Fields.CombinedApprovalStatus)
.Equals(ApprovalStatus.DISAPPROVED.ToString())
.OrderByAscending(Ad.Fields.Id)
.DefaultLimit()
.Build();

AdGroupAdPage page = new AdGroupAdPage();
int disapprovedAdsCount = 0;
Expand All @@ -86,11 +88,8 @@ public void Run(AdWordsUser user, long campaignId)
{
do
{
string queryWithPaging =
string.Format("{0} LIMIT {1}, {2}", query, offset, pageSize);

// Get the disapproved ads.
page = adGroupAdService.query(queryWithPaging);
page = adGroupAdService.query(query);

// Display the results.
if (page != null && page.entries != null)
Expand Down Expand Up @@ -136,8 +135,8 @@ public void Run(AdWordsUser user, long campaignId)
}
}

offset += pageSize;
} while (offset < page.totalNumEntries);
query.NextPage(page);
} while (query.HasNextPage(page));

Console.WriteLine("Number of disapproved ads found: {0}", disapprovedAdsCount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.Util.Reports;
using Google.Api.Ads.AdWords.Util.Reports.v201802;
using Google.Api.Ads.AdWords.v201802;
using Google.Api.Ads.Common.Util.Reports;

Expand Down Expand Up @@ -70,10 +71,13 @@ public override string Description
/// </param>
public void Run(AdWordsUser user, string fileName)
{
string query =
"SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, Impressions, " +
"Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE Status IN [ENABLED, PAUSED] " +
"DURING LAST_7_DAYS";
ReportQuery query = new ReportQueryBuilder()
.Select("CampaignId", "AdGroupId", "Id", "Criteria", "CriteriaType",
"Impressions", "Clicks", "Cost")
.From(ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT)
.Where("Status").In("ENABLED", "PAUSED")
.During(ReportDefinitionDateRangeType.LAST_7_DAYS)
.Build();

string filePath =
ExampleUtilities.GetHomeDir() + Path.DirectorySeparatorChar + fileName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.Util.Reports;
using Google.Api.Ads.AdWords.Util.Reports.v201802;
using Google.Api.Ads.AdWords.v201802;
using Google.Api.Ads.Common.Util.Reports;

Expand Down Expand Up @@ -302,9 +303,11 @@ public void Run(AdWordsUser user, string downloadFolder)
ReportDownloadData[] threadData = new ReportDownloadData[MAX_NUMBER_OF_THREADS];

// The query to be run on each account.
string query = "SELECT CampaignId, AdGroupId, Impressions, Clicks, Cost from " +
"ADGROUP_PERFORMANCE_REPORT where AdGroupStatus IN [ENABLED, PAUSED] " +
"DURING LAST_7_DAYS";
ReportQuery query = new ReportQueryBuilder()
.Select("CampaignId", "AdGroupId", "Impressions", "Clicks", "Cost")
.From(ReportDefinitionReportType.ADGROUP_PERFORMANCE_REPORT)
.Where("AdGroupStatus").In("ENABLED", "PAUSED")
.During(ReportDefinitionDateRangeType.LAST_7_DAYS).Build();

// Initialize the threads and their data.
for (int i = 0; i < MAX_NUMBER_OF_THREADS; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.Util.Reports;
using Google.Api.Ads.AdWords.Util.Reports.v201802;
using Google.Api.Ads.AdWords.v201802;
using Google.Api.Ads.Common.Util.Reports;

Expand Down Expand Up @@ -72,9 +73,12 @@ public override string Description
public void Run(AdWordsUser user)
{
// Create the query.
string query =
"SELECT Id, AdNetworkType1, Impressions FROM CRITERIA_PERFORMANCE_REPORT " +
"WHERE Status IN [ENABLED, PAUSED] DURING LAST_7_DAYS";
ReportQuery query = new ReportQueryBuilder()
.Select("Id", "AdNetworkType1", "Impressions")
.From(ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT)
.Where("Status").In("ENABLED", "PAUSED")
.During(ReportDefinitionDateRangeType.LAST_7_DAYS)
.Build();

ReportUtilities reportUtilities = new ReportUtilities(user, "v201802", query,
DownloadFormat.GZIPPED_XML.ToString());
Expand Down
Loading

0 comments on commit abadaed

Please sign in to comment.