Hi there,
I have started using AdWords API, so far I have been able to use all the 
Basic Operations. However now I am trying to use AdParameteres for the Ads 
been unsuccessful so far. 

I have created a campaign, an Ad group, 4 keywords and 1 ad.
The Ad:

Headline: This test title
description1: This test {param1:$20}
description2: for ads {param2:50}
displayUrl: www.example.com
url: http://www.example.com

The code I am using is:

  $adParamService = $user->GetService('AdParamService', 'v201206');

  // Create ad parameters.
  $adParam1 = new AdParam($adGroupId, $keywordId, '$80', 1);  //keywordId 
existing under the same AdGroup
  $adParam2 = new AdParam($adGroupId, $keywordId, '18', 2);   //keywordId 
existing under the same AdGroup

  // Create operations.
  $operation1 = new AdParamOperation($adParam1, 'SET');
  $operation2 = new AdParamOperation($adParam2, 'SET'); 

  // Make the mutate request.
  $adParams = $adParamService->mutate(array($operation1, $operation2));

  // Display results.
  foreach ($adParams as $adParam) {
    printf("Ad parameter with insertion text '%s' and parameter index '%s' "
        . "was set.\n", $adParam->insertionText, $adParam->paramIndex);
  }

try {
  // Get AdWordsUser from credentials in "../auth.ini"
  // relative to the AdWordsUser.php file's directory.
      $user = new AdwordsUser(
'./auth.ini',     // $authenticationIniPath
null,             // $email 
null,             // $password
null,             // $developerToken
null,             // $applicationToken
null,             // $userAgent
null,             // $clientId
'./settings.ini' // $settingsIniPath
);

  // Log every SOAP XML request and response.
  $user->LogAll();

  // Run the example.
  SetAdParametersExample($user, $adGroupId, $keywordId);
} catch (Exception $e) {
  printf("An error has occurred: %s\n", $e->getMessage());
}


However every time I try to execute the script it always returns:
An error has occurred: Unmarshalling Error: For input string: "param1" 

I havent been able to find any help on this issue or similar problem.

I would really appreciate your help as I have been on this matter for 
couple of days already.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to