Comments (4)
Hi @Sotacan, it's pretty late here right now, but I'll take a look tomorrow and get back to you!
from google-ads-node.
So it looks like the phone_call_duration_seconds
is now causing issues. If you use a try/catch block like I mentioned previously, this error would be visible in your terminal!
It seems to not allow phone_call_duration_seconds
to be set when using the type: enums.ConversionActionType.WEBPAGE
. I managed to get it working when setting the type to enums.ConversionActionType.AD_CALL
.
Again, I'm not an expert in all the settings for conversion actions, so it may be worth getting in contact with the Google Ads API support team.
from google-ads-node.
Hi @Sotacan, I've taken a look and found a solution to your issue.
It looks as if you were not correctly specifying the type
field of the conversion action object. The value 0
means UNSPECIFIED
, which I assume isn't allowed in Google Ads? (I may be wrong here). If I set that to another value, the request appears to work.
Using this as the conversion action object works for me:
const conversion = {
name: 'my-conversion-action',
status: enums.ConversionActionStatus.ENABLED,
type: enums.ConversionActionType.AD_CALL,
category: enums.ConversionActionCategory.PURCHASE,
include_in_conversions_metric: true,
click_through_lookback_window_days: 30,
// view_through_lookback_window_days: 1,
attribution_model_settings: {
attribution_model: enums.AttributionModel.GOOGLE_ADS_LAST_CLICK,
},
value_settings: {
// always_use_default_value: false,
default_currency_code: 'USD',
default_value: 1,
},
}
I've commented out two fields which appear to cause problems, perhaps they can't be set when initially creating the conversion action.
I'd highly recommend using the enums
import instead of using the direct values, e.g.
status: enums.ConversionActionStatus.ENABLED, // good
status: 1, // bad
The enums
module can be imported with GoogleAdsApi
, like so:
const { GoogleAdsApi, enums } = require('google-ads-api');
I would also strongly recommend using TypeScript if possible. This will allow you to use the types
import, which makes working with theses complex objects much easier.
You can also get much better debugging information if you wrap your code in a try/catch block, and avoid using the setTimeout
:
try {
const result = await customer.conversionActions.create(conversion_action)
console.log(result)
} catch (err) {
console.log('Error creating conversion action:')
// The err object includes details on which particular key is missing
console.log(err)
}
Let me know if you still have problems!
from google-ads-node.
Hmm i have the same issue, and thanks enums is sweet.
https://gyazo.com/26afd8a417a05645240fb9a79829d04c
from google-ads-node.
Related Issues (20)
- Please update protos for v11.1 HOT 3
- Upgrade Google Ads to v13
- Upgrade Google Ads to v14
- Upgrade Google Ads to v15 HOT 3
- module growing in size, making use in a AWS function impossible HOT 1
- v13 of google-ads-node contains 2 versions of google api
- Upgrade to Google Ads API v17.1 HOT 3
- Receiving RESOURCE_EXHAUSTED: received trailing metadata size exceeds limit HOT 1
- Upgrade Google Ads to v6 HOT 1
- Using with Google service account and JWT HOT 1
- Next.js: Module not found: Can't resolve 'child_process' HOT 1
- High memory usage HOT 2
- Long initial init time HOT 1
- Huge package size HOT 2
- keywordPlanIdeas.generateKeywordIdeas() is returning dumb fileds
- Compilation issues with M1 chips
- Problem with authorization HOT 1
- How to authorize UserDataServiceClient
- lead_form_submission_data.proto is missing HOT 2
- Project structure question HOT 2
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-node.