I am trying to get keyword from "adwords" from the sandbox,but i didn't get real result.

1,071 views
Skip to first unread message

devdeep

unread,
Sep 3, 2012, 3:21:02 AM9/3/12
to adwor...@googlegroups.com

I am trying to get all the "adwords" from the sandbox, what I see when I run getRelatedKeywords.php is this:

Keyword idea with text 'red herring 3b3e7c68', match type 'EXACT', and average monthly search volume '301000' and global search volume '301000' and search volume '0' was found. Array
Keyword idea with text 'web 13b5d34f', match type 'EXACT', and average monthly search volume '301000' and global search volume '301000' and search volume '0' was found. Array
Keyword idea with text 'web 45bf01ce', match type 'EXACT', and average monthly search volume '301000' and global search volume '301000' and search volume '0' was found. Array

i dont passes 'red herring' keyword and in my result i found 'red herring' keyword with some numer at the and of the keyword like 'red herring 3b3e7c68' what is that no?

and global and monthly searcch had also same volume.

and i also want to search with url  that also not give me the real result

my code is like this:

$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com/");
$user->LogAll();
$user->SetClientId(null);
 
try {
    // Get the service, which loads the required classes.
  $targetingIdeaService = $user->GetService('TargetingIdeaService', 'v201109');

  // Create seed keyword.
  $keyword = new Keyword();
  $keyword->text = 'web';
  $keyword->matchType = 'EXACT';


  // Create selector.
  $selector = new TargetingIdeaSelector();
  $selector->requestType = 'IDEAS';
  $selector->ideaType = 'KEYWORD';
  $selector->EXTRACTED_FROM_WEBPAGE='www.acmewebitech.com';
  $selector->requestedAttributeTypes =
      array('CRITERION', 'AVERAGE_TARGETED_MONTHLY_SEARCHES','GLOBAL_MONTHLY_SEARCHES');

  // Create related to keyword search parameter.
 $selector->searchParameters[] =
      new RelatedToKeywordSearchParameter(array($keyword));

  // Create keyword match type search parameter to ensure unique results.
  $selector->searchParameters[] =
      new KeywordMatchTypeSearchParameter(array('EXACT'));


  // Set selector paging (required by this service).
  $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);

  do {
    // Make the get request.
    $page = $targetingIdeaService->get($selector);

    // Display results.
    if (isset($page->entries)) {
      foreach ($page->entries as $targetingIdea) {
              echo $targetingIdea->data;
        $data = MapUtils::GetMap($targetingIdea->data);
        $keyword = $data['CRITERION']->value;
        $averageMonthlySearches =
            isset($data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value)
            ? $data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value : 0;
           
        $globalMonthlySearch=   
        isset($data['GLOBAL_MONTHLY_SEARCHES']->value)
            ? $data['GLOBAL_MONTHLY_SEARCHES']->value : 0;
           
            $volume_search=isset($data['SEARCH_VOLUME']->value)
            ? $data['SEARCH_VOLUME']->value : 0;
        printf("<br/>Keyword idea with text '%s', match type '%s', and average "
            . "monthly search volume '%s' and global search volume '%s' and search volume '%s' was found.\n", $keyword->text,
            $keyword->matchType, $averageMonthlySearches,$globalMonthlySearch,$volume_search);
      }
    } else {
      print "No keywords ideas were found.\n";
    }

    // Advance the paging index.
    $selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
  } while ($page->totalNumEntries > $selector->paging->startIndex);
} catch (Exception $e) {}

Evgeniy Bogdanov

unread,
Sep 3, 2012, 4:36:24 AM9/3/12
to adwor...@googlegroups.com
You will not get real result from sandbox. It uses dummy data for testing purposes only. You need to switch for production server to get real data.
Also I suggest you to read terms of use and minimum requirements to not go in situation when your API token will be revoked.

Regards,
Evgeniy.

Ethan Lyon

unread,
Jan 3, 2015, 2:45:25 PM1/3/15
to adwor...@googlegroups.com
Would you be able to elaborate on what you mean by the terms of use situation?

I'd like to pull keyword search volume from the Adwords API but did not read anything that explicitly prohibits this request here: https://developers.google.com/adwords/api/docs/terms?csw=1. I want to be 100% compliant with the terms of use as to not have my privileges denied.

Josh Radcliff (AdWords API Team)

unread,
Jan 5, 2015, 10:16:29 AM1/5/15
to adwor...@googlegroups.com
Hi,

The AdWords API Team cannot answer policy questions, but you can contact the API Compliance Team via this form for assistance.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages