Comments (4)
Hey!
Try something like this:
const campaign_criterion = {
campaign: 'customers/xxxxxxx/campaigns/xxxxxxxxx',
location: { geo_target_constant: 'geoTargetConstants/2004' }
}
const result = await customer.campaignCriterion.create(campaign_criterion)
I haven't tested this snippet, but that's the general structure :)
from google-ads-api.
Interesting and thanks for responding,
What would be the geoTargetConstants/2004
? Is it in general location ID (the 2004)
Something like geoTargetConstants/${locationID}
if not, how can we make geoTargetConstants/2004
?
from google-ads-api.
Yes, it's the locationID
. You can get every single geoTargetConstant and their associated location IDs by running:
const result = await customer.geoTargetConstants.list()
I don't think we provide any helper functions to build resource names from IDs yet, but we might in the future. The idea, according to Google, is that you're supposed to use the resource names instead of IDs.
from google-ads-api.
Okay, To start with I did something pretty simple
const glkData = {
campaign: cachedandTargetData.campaignPath, //My Campaign Path
name: googleAdData.name,
age_range: "AGE_RANGE_18_24",
}
const targetingData = await this.customer.campaignCriterion.create(glkData)
I also tried combinations with age Range like passing an array
age_range: ["AGE_RANGE_18_24"],
enums.AgeRangeType["AGE_RANGE_18_24"]
but it keeps throwing following error
Criteria type can not be targeted.
Others were easy because resources had an example for them. Can you please help me out on this one?
from google-ads-api.
Related Issues (20)
- Can't create ad_group_ad_critetion with age and gender at the same time
- "The client has already been closed" Error thrown HOT 2
- Wait for response forever in Cloud Functions
- unable to compile with 13.0.1
- No information on documentation HOT 1
- Adding/Removing Criteria, and missing Documentation HOT 1
- OPERATION_NOT_PERMITTED_FOR_REMOVED_RESOURCE
- List customers with their descriptive names
- Why is `toJSON` required for `generateKeywordIdeas`?
- Authentication Error
- Upgrade Google Ads API to v15 HOT 19
- How to create a custom segment via the SDK? HOT 1
- Customer report showing previous day's data when date_constant is 'TODAY'
- Bad resource id in query from conversion_action HOT 1
- TypeError: this.auth.getUniverseDomain is not a function HOT 1
- Query returns campaign data, but report options does not based on TODAY date_constant
- size of module growing, making use with AWS lambda functions difficult HOT 2
- Can't change a Promotion Asset from "Money Amount Off" to "Percent Off".
- Inquiry on Support for HTTP Proxy
- Service Account Authentication HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-ads-api.