RE: SearchStream Vs Search

2020-04-14 Thread Google Ads API Forum Advisor Prod
Hi Sreenu,

Thank you for your query. I see that you're putting the incorrect field in the 
"FROM" clause. I've written an example query for you below that you can 
populate with fields from this document.

"SELECT operating_system_version_constant.id, 
operating_system_version_constant.name, 
operating_system_version_constant.os_major_version, 
operating_system_version_constant.os_minor_version FROM 
operating_system_version_constant"

You can see that the FROM clause is pulling from the operating system version 
constant report type. Let me know if you have further questions.

Thank you,
Bryan, Google Ads API Team
ref:_00D1U1174p._5001UZVXb6:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7gk1k0Q8SGQC00NEl6rERPRaKNea2mxGMWnw%40sfdc.net.


Re: SearchStream Vs Search

2020-04-13 Thread sreenu malae

>
> Hey Bryan,


$query = "SELECT
 campaign_criterion.operating_system_version.operating_system_version_constant 
FROM campaign_criterion"; 
$response = $googleAdsServiceClient->search($customerId, $query, ['pageSize'
 => self::PAGE_SIZE]); 
foreach ($response->iterateAllElements() as $googleAdsRow) {
echo($googleAdsRow->getCampaignCriterion()->getOperatingSystemVersion());
}

I tried the above code But still i'm not getting the proper output. I'm 
getting a object and i think has null values 
Can you please help me out. 

>  

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4662f263-411b-401c-893c-377904e70b02%40googlegroups.com.


RE: SearchStream Vs Search

2020-04-13 Thread Google Ads API Forum Advisor Prod
Hi Sreenu,

Could you provide me with the search query you've used? You can only query 
fields in Operating_System_Version_Constant if this report is specified in the 
"From" field in your query. Please let me know.

Thank you,
Bryan, Google Ads API Team
ref:_00D1U1174p._5001UZVXb6:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/V4KNP0Q8QP2L00Um34N0QJQoOT2tDosekegA%40sfdc.net.


Re: SearchStream Vs Search

2020-04-10 Thread sreenu malae

>
> Hey Bryan, 


I'm Facing a error

`
Google Ads failure details:
query_error: Cannot select fields from the following resource: 
'OPERATING_SYSTEM_VERSION_CONSTANT', since the resource is incompatible 
with the resource in FROM clause.
`
 Can you please provide me some example ?
 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/dc9e3981-3d54-4e09-87fd-bbf4781d82b0%40googlegroups.com.


RE: SearchStream Vs Search

2020-04-10 Thread Google Ads API Forum Advisor Prod
Hi Sreenu,

You should be able to use the Operating_System_Version_Constant report to get 
the OS of the device. Let me know if you have further questions.

Thank you,
Bryan, Google Ads API Team
ref:_00D1U1174p._5001UZVXb6:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/wPutF0Q8L6X600UoTYz2OBSlaRav9QTVqJUg%40sfdc.net.


Re: SearchStream Vs Search

2020-04-09 Thread sreenu malae
Hey Bryan,

Thanks for your continuous support, 

I would like to know one thing.
In google ads api V3 using segemts.device we are able to get the device 
type.
Either mobile computer etc..
Is there any way to get data either the mobile phones are Android, IOS or 
something else ? 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ccdae341-71f4-414e-9820-5e9cf43f800c%40googlegroups.com.


Re: SearchStream Vs Search

2020-04-01 Thread sreenu malae

>
> Hey Bryan,


Thanks I got it. 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9be8af89-4d2e-414d-a7ca-5f0b9a4aaa19%40googlegroups.com.


Re: SearchStream Vs Search

2020-04-01 Thread sreenu malae

>
> Hey Bryan,



 Over here  array_push($emptyarray,$googleAdsRow->getAdGroup()->
getId()->getValue());
I'm just trying to push the values to array. Its just for reference.
But even in the printf i'm getting the null values
The above code I modified based on Adgroups 
. 
Still i'm getting the null values.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7a801194-0462-4b48-a2d5-03bf21a73d1f%40googlegroups.com.


RE: SearchStream Vs Search

2020-04-01 Thread Google Ads API Forum Advisor Prod
Hi Sreenu,

Thanks for reaching out to us. I see that in your code you're using the 
get_campaigns example, but are trying to push ad_groups into your array. For 
reference, here is the code snippet I'm talking about.

array_push($emptyarray,$googleAdsRow->getAdGroup()->getId()->getValue());
printf( "Ad group with ID %d and name '%s' was found in campaign with ID .%s", 
$googleAdsRow->getCampaign()->getId()->getValue(), 
$googleAdsRow->getCampaign()->getName()->getValue(), PHP_EOL

Where you have "getAdGroup()->getId()->getValue()" you're trying to push into 
an array AdGroups when your code is querying Campaigns.

If you would like to query Ad Groups, I'd suggest using this example to obtain 
a list of ad groups under a campaign. Let me know if you have further questions.

Thank you,
Bryan, Google Ads API Team
ref:_00D1U1174p._5001UZVXb6:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/r44Oo0Q84JGQ00xkQYcXoRRfGngACSbDLapw%40sfdc.net.


SearchStream Vs Search

2020-04-01 Thread sreenu malae
In getcampaigns 

 
instead of using search stream im trying to use search.
But I'm getting null values


namespace Google\Ads\GoogleAds\Examples\BasicOperations;

require __DIR__ . '/../../vendor/autoload.php';

use GetOpt\GetOpt;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentNames;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentParser;
use Google\Ads\GoogleAds\Lib\V3\GoogleAdsClient;
use Google\Ads\GoogleAds\Lib\V3\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Lib\V3\GoogleAdsException;
use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\Lib\V3\GoogleAdsServerStreamDecorator;
use Google\Ads\GoogleAds\V3\Errors\GoogleAdsError;
use Google\Ads\GoogleAds\V3\Services\GoogleAdsRow;
use Google\Ads\GoogleAds\V3\Services\SearchGoogleAdsStreamResponse;
use Google\Ads\GoogleAds\V3\Services\SearchGoogleAdsResponse;
use Google\ApiCore\ApiException;
/** This example gets all campaigns. To add campaigns, run AddCampaigns.php. */
class GetCampaigns
{
const CUSTOMER_ID = '**';

public static function main()
{
   $options = (new ArgumentParser())->parseCommandArguments([
ArgumentNames::CUSTOMER_ID => GetOpt::REQUIRED_ARGUMENT
]);
// Generate a refreshable OAuth2 credential for authentication.
// $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();

// // Construct a Google Ads client configured from a properties file 
and the
// // OAuth2 credentials above.
// $googleAdsClient = (new GoogleAdsClientBuilder())
// ->fromFile()
// ->withOAuth2Credential($oAuth2Credential)
// ->build();
$oAuth2Credential = (new OAuth2TokenBuilder())

->withClientId('*-p4i6a80tjrm4kgp5akfs6bp00liq2601.apps.googleusercontent.com')
->withClientSecret("**")

->withRefreshToken('***')
->build();
$googleAdsClient = (new GoogleAdsClientBuilder())
->withOAuth2Credential($oAuth2Credential)
->withDeveloperToken('**')
->withLoginCustomerId('**')
->build();

try {
self::runExample(
$googleAdsClient,
$options[ArgumentNames::CUSTOMER_ID] ?: self::CUSTOMER_ID
);
} catch (GoogleAdsException $googleAdsException) {
printf(
"Request with ID '%s' has failed.%sGoogle Ads failure 
details:%s",
$googleAdsException->getRequestId(),
PHP_EOL,
PHP_EOL
);
foreach ($googleAdsException->getGoogleAdsFailure()->getErrors() as 
$error) {
/** @var GoogleAdsError $error */
printf(
"\t%s: %s%s",
$error->getErrorCode()->getErrorCode(),
$error->getMessage(),
PHP_EOL
);
}
} catch (ApiException $apiException) {
printf(
"ApiException was thrown with message '%s'.%s",
$apiException->getMessage(),
PHP_EOL
);
}
}

/**
 * Runs the example.
 *
 * @param GoogleAdsClient $googleAdsClient the Google Ads API client
 * @param int $customerId the customer ID
 */
public static function runExample(GoogleAdsClient $googleAdsClient, int 
$customerId)
{

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
// Creates a query that retrieves all campaigns.
$query = 'SELECT campaign.id, campaign.name FROM campaign ORDER BY 
campaign.id';
// Issues a search stream request.
$stream =$googleAdsServiceClient->search($customerId, $query);
$emptyarray=array();
foreach ($stream->iterateAllElements() as $googleAdsRow) {
/** @var GoogleAdsRow $googleAdsRow */

array_push($emptyarray,$googleAdsRow->getAdGroup()->getId()->getValue());
printf(
"Ad group with ID %d and name '%s' was found in campaign with 
ID .%s",
$googleAdsRow->getCampaign()->getId()->getValue(),
$googleAdsRow->getCampaign()->getName()->getValue(),
PHP_EOL
);
}
echo count($emptyarray);

}
}

GetCampaigns::main();

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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...@goog