1
votes

I am trying to make a conversion in AdWords Api with a Adwords test account:

            OfflineConversionFeed feed = new OfflineConversionFeed();
            feed.conversionName = conversionName;
            feed.conversionTime = conversionTime;
            feed.conversionValue = conversionValue;
            feed.googleClickId = gClid;

I am using the latest AdWords .NET libriary by @AnashOommen

I keep getting from my API request the following exception:


An exception occurred while running this code example. System.ApplicationExcepti on: Failed upload offline conversions. ---> Google.Api.Ads.AdWords.Lib.AdWordsAp iException: An API exception has occurred. See ApiException and InnerException f ields for more details. ---> System.Web.Services.Protocols.SoapException: DateEr ror.INVALID_STRING_DATE_TIME @ ; trigger:'7/14/2014 6:30:00 AM' at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie ntMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)


One more thing, I found that in Adwords documentation:

All time zones must be in full hour or half-hour increments relative to Greenwich Mean Time. If your local time zone is one of the few offset a quarter-hour from GMT, the AdWords system can't support your time zone. Please choose a different time zone for your account.

I tried many date formats such:

  1. YYYYMMDD HH:MM:SS
  2. MM/dd/yyyy HH:mm:ss

And many more, non of them worked.

My local time is different then the time zone in my test account( Central Standard Time ) I prefer not to change the time in my test account because i want it to be the same as the production account.

Any help would by appreciated.

2

2 Answers

3
votes

With a little help from Adsword support, the right format is : 20140714 060000 Europe/Berlin

I added the timezone (Europe/Berlin) next to the date.

DateTime.Now.ToString("yyyyMMdd HHmmss") + " Europe/Berlin";

That solved the INVALID_STRING_DATE_TIME error.

0
votes

SOAP usually requires values in ISO8601 format, and should include a time zone offset.

For example: 2014-07-14T01:23:45-05:00

Assuming conversionTime is a DateTime or DateTimeOffset type, try formatting it with the ISO8601 compliant "round-trip format specifier": .ToString("o").