Re: Download campaigns - Not included in report

2017-01-06 Thread Vikram Tiwari
Hey Peter - I tried it that way and it seems that I started missing more 
campaigns.

Campaign Query: `SELECT CampaignId FROM CAMPAIGN_PERFORMANCE_REPORT DURING 
YESTERDAY`

I expect this query to return all the results, regardless of campaign type. 
I pass the result of this query to following:

Delivery Query: `SELECT Date,HourOfDay, AdGroupId, 
AdGroupName,AdNetworkType1, CampaignId, CampaignName, Impressions, Clicks, 
Cost FROM ADGROUP_PERFORMANCE_REPORT  WHERE CampaignId IN 
[CAMPAIGN_QUERY_RESULT] DURING YESTERDAY`

The resultant data is less than when I do Delivery Query without passing 
CampaignIds restriction. Haven't dived in there to find which campaigns are 
missing, but the process seems to be not work.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9b484326-bb46-4cf6-89fc-36c1e321f7e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Selector fields for both TextAd, ExpandedTextAd

2017-01-06 Thread 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
Hi Andy, 

Yes, you can have both TextAd and ExpandedTextAd in an Adgroup. In the 
selector you could add 
'.in(AdGroupAdField.AdType,"TEXT_AD","EXPANDED_TEXT_AD")'.

Thanks,
Sreelakshmi, AdWords API Team

On Friday, January 6, 2017 at 2:36:31 PM UTC-5, Andy Lin wrote:
>
> Can we have both TextAd and ExpandedTextAd in Adgroup?  If yes, can I use 
> one selector to get all the ads (Both TextAd, ExpandedTextAd) for the 
> adgroup, avoid to make 2 remote calls?
>
> Selector selector = builder.fields(AdGroupAdField.Id, AdGroupAdField.
> AdGroupId,AdGroupAdField.Headline, AdGroupAdField.
> description1,AdGroupAdField.headlinePart1, AdGroupAdField.headlinePart2,
>  AdGroupAdField.CreativeFinalUrls).orderAscBy(AdGroupAdField.AdGroupId) 
>
> .offset(offset)
>
> .equals(AdGroupAdField.Status, AdGroupAdStatus._ENABLED)
>
> .in(AdGroupAdField.AdGroupId, predicateGroupIDs).limit(PAGE_SIZE).build();
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3786dfb0-25ba-443c-97d4-d8d4c9a5932c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to resolve manager accounts throwing the USER_PERMISSION_DENIED error

2017-01-06 Thread ccyr71

>
> Sreelakshmi,
>

We are not seeing this behavior.  Our customer seems to have created a new 
credential (a non-MCC account).  When trying to get the list of accounts 
for this credential, and using the customerId of their client account 
(xxx-xxx-) we are unable to get access.  We get 
back AuthorizationError.USER_PERMISSION_DENIED error.  With our internal 
testing account, which is an MCC account, we are able to login and return 
the list of linked accounts.  Do you have any ideas why this would happen? 
 Are there any other permissions/setup that needs to be done?

-Chris
Dev Team Lead, Mediaocean

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4216a4e9-da8e-4e56-8abe-73abbb6ebdd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: AuthorizationError.USER_PERMISSION_DENIED

2017-01-06 Thread 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum

Hi, 

The USER_PERMISSION_DENIED 

 error 
occurs if the client account is not linked to the manager account or, in a 
different scenario where the OAuth credentials do not match the client 
customer ID that was specified in the request. I would suggest to check if 
the accounts are properly linked and also ensure that you are logged into 
the right account while you accept the action on the consent screen.

Thanks,
Sreelakshmi, AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8932d544-5e8e-419c-a76e-c29f5fb9ad83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Query for traffic share of experiment in keyword performance report or some other report.

2017-01-06 Thread 'Vishal Vinayak (Adwords API Team)' via AdWords API Forum
Hi Artem,

You can get that information from the field trafficSplitPercent 

 using 
the TrailService 
.
 
Please revert if you have additional questions.

Regards,
Vishal, AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/12e03973-e0bf-4c86-a5c9-6307d538959c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Selector fields for both TextAd, ExpandedTextAd

2017-01-06 Thread Andy Lin
Can we have both TextAd and ExpandedTextAd in Adgroup?  If yes, can I use 
one selector to get all the ads (Both TextAd, ExpandedTextAd) for the 
adgroup, avoid to make 2 remote calls?

Selector selector = builder.fields(AdGroupAdField.Id, AdGroupAdField.
AdGroupId,AdGroupAdField.Headline, AdGroupAdField.
description1,AdGroupAdField.headlinePart1, AdGroupAdField.headlinePart2,
 AdGroupAdField.CreativeFinalUrls).orderAscBy(AdGroupAdField.AdGroupId) 

.offset(offset)

.equals(AdGroupAdField.Status, AdGroupAdStatus._ENABLED)

.in(AdGroupAdField.AdGroupId, predicateGroupIDs).limit(PAGE_SIZE).build();

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/165a4ae9-86c6-4d52-aa8b-66c565c816aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


AuthorizationError.USER_PERMISSION_DENIED

2017-01-06 Thread Minas Gratas
Hello,

I am working on a basic application which does reporting for our clients. 
It work for my MCC account but I want my clients to log in with their 
Adwords accounts and see their campaigns, ad groups and keywords.

Basically, I am having an issue on the first step of OAUTH here.

use Google\Auth\OAuth2;
require_once 'adwords/api/vendor/autoload.php';
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201609\cm\CampaignService;
use Google\AdsApi\AdWords\v201609\cm\OrderBy;
use Google\AdsApi\AdWords\v201609\cm\Paging;
use Google\AdsApi\AdWords\v201609\cm\Selector;
use Google\AdsApi\Common\OAuth2TokenBuilder;

session_start();

$oauth2 = new OAuth2([
'authorizationUri' => 'https://accounts.google.com/o/oauth2/v2/auth',
'tokenCredentialUri' => 'https://www.googleapis.com/oauth2/v4/token',
'redirectUri' => 'http://localhost:32492/adoauth/',
'clientId' => '',
'clientSecret' => '*',
'scope' => 'https://www.googleapis.com/auth/adwords'
]);

if (!isset($_GET['code'])) {
// Create a 'state' token to prevent request forgery.
// Store it in the session for later validation.
$oauth2->setState(sha1(openssl_random_pseudo_bytes(1024)));
$_SESSION['oauth2state'] = $oauth2->getState();

// Redirect the user to the authorization URL.
$config = [
// Set to 'offline' if you require offline access.
'access_type' => 'offline'
];
header('Location: ' . $oauth2->buildFullAuthorizationUri($config));
exit;
}
 elseif (empty($_GET['state'])

|| ($_GET['state'] !== $_SESSION['oauth2state'])) {
  unset($_SESSION['oauth2state']);
  exit('Invalid state.');
} else {
$oauth2->setCode($_GET['code']);
$authToken = $oauth2->fetchAuthToken();

$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oauth2)
->build();

$adWordsServices = new AdWordsServices();

$campaignService = $adWordsServices->get($session, CampaignService::class);
$selector = new Selector();

$selector->setFields(array('Id', 'Name'));
$selector->setOrdering(array(new OrderBy('Name', 'ASCENDING')));

$page = $campaignService->get($selector);
if (isset($page->entries)) {

foreach ($page->entries as $campaign) {
$campaigns[] = ['id'=>$campaign->id, 'name'=>$campaign->name, 
'status'=>$campaign->status];
}
return $campaigns;
} else {
print "No campaigns were found.\n";
}
}


So I am giving permissions on consent screen, thenI should get the 
authenticated users data such as campaigns, ad groups. However I am having 
this error;
Fatal error: Uncaught exception 
'Google\AdsApi\AdWords\v201609\cm\ApiException' with message 
'[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'']

Can someone please help me what I am missing?

Also I am using two different libraries here, one for oAuth and one for 
Adwords API.

Thank you

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/19295ded-db0e-4343-aa8c-28e726d9dad0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Query for traffic share of experiment in keyword performance report or some other report.

2017-01-06 Thread Artem Budishchev
Hi all,

I have a question regarding experiments (or trials): is it possible to 
query for traffic share of an experiment through the API?

For instance, in keyword performance report I can query for the base 
campaign id, but I would also like to know how much of the traffic was 
allocated from the base campaign to the experiment, e.g. 0.5/0.5 or 0.3/0.7 
etc.

I can see this on the website (experiment split), but not in the API 
documentation.

Thanks in advance!

Cheers,
Artem.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/1f6c6031-0eff-4c56-8028-1d87f5776214%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: some questions regarding drafts and experiments

2017-01-06 Thread Artem Budishchev
Hi Nadine,

Sure no problem, I'll do it right away.

Cheers,
Artem.

On Friday, January 6, 2017 at 4:03:10 AM UTC+1, Nadine Sundquist (AdWords 
API Team) wrote:
>
> HI Artem,
>
> Could you do me a huge favor and start a new thread for this question, 
> please? It makes it so much easier for people to search and read later if 
> they have the same kind of question.
>
> Thanks!
> Nadine, AdWords API Team
>
> On Thursday, January 5, 2017 at 4:06:01 PM UTC-5, Artem Budishchev wrote:
>>
>> Hi all!
>>
>> Sorry for hijacking the question. 
>>
>> I have a small question: is it possible to also query for the traffic 
>> share set in the experiments in keyword performance reports (or any other 
>> report)?
>> I could find only the base campaign id field, but would also like to have 
>> a traffic share value like 0.5 for base campaign id and 0.5 for experiment 
>> for instance in the report.
>>
>> Cheers,
>> Artem.
>>
>> On Wednesday, November 16, 2016 at 12:42:16 PM UTC+1, Imran Tufail wrote:
>>>
>>> Hi there!
>>>
>>> I want to ask some questions regarding drafts and experiments.
>>>
>>> 1. Can i create the *Drafts* through batch job service ?
>>> 2. Can i create the *experiments* through batch job service ?
>>> 3. How i can get the *statistics* of an Experiment vs the original 
>>> campaign (comparison) ?
>>> 4. After creating an experiment from a draft, Is further changes 
>>> (suppose add more Ads) to this* draft will reflect the changes to 
>>> corresponding experiment* ?
>>> 5. Is any way to modify the experiment directly (add new Ads etc) ?
>>>
>>> Regards
>>> Imran Tufail
>>>
>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c65a795d-bae6-42a7-9984-5201f870b7e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.