Results 1 to 4 of 4

 

Thread: Adwords API error

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Sep 2003
    Posts
    315
    Thanks
    28
    Thanked 19 Times in 16 Posts


    Hello I am getting an error when I try to update keyword params and insert the £ into an ad.

    Here's my code:

    // Get the AdParamService.
    $adParamService = $user->GetAdParamService('v200909');

    $adgroup_id = $adgroup_id;
    $keywordId = $keyword_id;

    // Create ad parameters.
    $adParam1 = new AdParam($adgroup_id, $keywordId, "$price", 1);

    $operation = new AdParamOperation('£$adParam1', 'SET');

    $adParams = $adParamService->mutate($operation);

    flush();

    and here's the output:

    Fatal error: Uncaught SoapFault exception: [soap:Server] [RequiredError.REQUIRED @ operations[0].operand.insertionText, RequiredError.REQUIRED @ operations[0].operand.paramIndex, RequiredError.REQUIRED @ operations[0].operand.criterionId, RequiredError.REQUIRED @ operations[0].operand.adGroupId] in /adwords-api/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:179 Stack trace: #0 /adwords-api/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(179): SoapClient->__soapCall('mutate', Array, NULL, Array, Array) #1 /adwords-api/src/Google/Api/Ads/AdWords/v200909/cm/AdParamService.php(2152): AdsSoapClient->__soapCall('mutate', Array) #2 /adwords-api/update-prices2/update-keyword-params.php(41): AdParamService->mutate(Object(AdParamOperation)) #3 /adwords-api/update-prices2/set-keyword-params.php(60): include('/web/sites/dusk...') #4 in /adwords-api/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 179

    Can't find a solution to this - please help.

    Thanks

    Tom

  2. #2
    buy.at tech

    Status
    Offline
    Join Date
    Jul 2008
    Posts
    64
    Thanks
    1
    Thanked 11 Times in 11 Posts
    This is most likely because SOAP uses XML to encode its messages, and £ is not generally a valid character in XML. The entity reference for £ is £ so try using that instead e.g.:

    $operation = new AdParamOperation('£$adParam1', 'SET');

    £ is sometimes used as an entity reference for £, but this isn't supported in all browsers whereas £ is.
    Ian Sproates, Head of Development (Newcastle), buy.at
    tel: +44 (0)191 222 9728 | email: ian.sproates@buy.at | icq: 490-111-853 | msn: sproates@hotmail.com

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Sep 2003
    Posts
    315
    Thanks
    28
    Thanked 19 Times in 16 Posts
    Hi Ian, thanks for the help on this.

    I found a way of doing it that's been working:

    $AdParam1 = new AdParam($adgroup_id, $keywordId, html_entity_decode('£'.$price_with_delivery _and_voucher, ENT_NOQUOTES, 'UTF-8'), 1);

    Basically copied it from a thread I found on Adwords. I'm afraid I've no idea what it means.

    Thanks again

    Tom

  4. #4
    buy.at tech

    Status
    Offline
    Join Date
    Jul 2008
    Posts
    64
    Thanks
    1
    Thanked 11 Times in 11 Posts
    It's basically a different way of doing what I said; '00A3' is 163 converted to hexadecimal, just another way of denoting HTML entities.
    Ian Sproates, Head of Development (Newcastle), buy.at
    tel: +44 (0)191 222 9728 | email: ian.sproates@buy.at | icq: 490-111-853 | msn: sproates@hotmail.com



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Google Announce New Adwords Based MMORPG - World Of Adwords
    By sweezely in forum Affiliate Marketing Lounge
    Replies: 5
    Last Post: 23-03-10, 09:09 PM
  2. Adwords Keyword reporting error
    By adrian in forum Affiliate Marketing Lounge
    Replies: 0
    Last Post: 03-10-06, 01:02 PM
  3. 'Referral Error' for a Google Adwords advert
    By moggsy in forum TradeDoubler
    Replies: 8
    Last Post: 03-06-05, 10:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2