Posts tagged with google-ads-api

I'm trying to understand the geo performance report in the Adwords API. Specifically, this note is tripping me up

Note: If you request both IsTargetingLocation values in your predicate and either do not limit by LocationType or request both LocationType values in your predicate, then the same impression's statistics may appear in multiple rows of the report. Therefore, statistic totals from your report could be much higher than totals from other reports such as the CAMPAIGN_PERFORMANCE_REPORT.

The way I understand it is, campaigns have a target location like New York. The field IsTargetingLocation can be true or false, where true means the corresponding impressions occurred in the target location and false means they didn't.

Additionally, the field LocationType can be either "Location of interest" (someone in Alabama is interested in New York) or "Physical location".

How can including both of these fields create double-counting? Someone is either in New York (IsTargetingLocation = true and LocationType = "Physical location") or they aren't (IsTargetingLocation = false and LocationType = "Location of interest").

I am trying to use the python googleads module in a script on Spyder.

I have run pip install googleads and the installation has succeeded.

However, when I try to import googleads in the script on Spyder, it gives me the below error:

ModuleNotFoundError: No module named 'googleads'

I have uninstalled the package and run pip install googleads again. The installation succeeds this time as well but the above error persists.

I have tried using conda install as well. That does not install the package.

However, when I run the script on the command prompt, it works fine. The issue is only with Spyder.

I have also Googled and looked up StackOverflow and most other communities for a solution to this but haven't been able to find one :(

Looking forward to some help here, to fix the issue.

Thank you in advance!

PS: I have run the pip install on the Anaconda prompt as well and that succeeds too. The error on Spyder still exists.

I have created google adCampaigns, adGroups, Keywords, Ads, Locations using Google Adwords API but I am not able to set "Set a maximum cost per click bid limit" using api

I have used this code to set but it's not getting set

       $operations = [];         // Create ad group with the specified ID.         $groupId = $adGroup->getId();         $adGroupNew = new AdGroup();         $adGroupNew->setId($groupId);         $cpcBidMicroAmount = intval($_GET['cpc']) * 1000000;         // Update the CPC bid if specified.         if (!is_null($cpcBidMicroAmount)) {             $bid = new CpcBid();             $money = new Money();             $money->setMicroAmount($cpcBidMicroAmount);             $bid->setBid($money);             $biddingStrategyConfiguration = new BiddingStrategyConfiguration();             $biddingStrategyConfiguration->setBids([$bid]);             $adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration);         }         // Create ad group operation and add it to the list.         $operation = new AdGroupOperation();         $operation->setOperand($adGroupNew);         $operation->setOperator(Operator::SET);         $operations[] = $operation;         // Update the ad group on the server.         $adGroupService->mutate($operations);