chrisalvares / node-adwords Goto Github PK
View Code? Open in Web Editor NEWAdwords SDK for NodeJS
License: MIT License
Adwords SDK for NodeJS
License: MIT License
Hello, @ChrisAlvares
I couldn't get access token.
Can you help me?
This is my code.
let auth = new AdwordsAuth({
client_id: config.Adwords.CLIENT_ID, //this is the api console client_id
client_secret: config.Adwords.CLIENT_SECRET_KEY
}, 'http://localhost:55980/service/adwords_account/auth' /** insert your redirect url here */ );
service.post('/service/authenticate', (req, res, next) => {
res.redirect(auth.generateAuthenticationUrl());
}
service.get('/service/adwords_account/auth', (req, res) => {
console.log(auth.generateAuthenticationUrl());
console.log('tokens...');
auth.getAccessTokenFromAuthorizationCode(req.query.code, (err, tokens) => {
//save access and especially the refresh tokens here
console.log(err);
console.log(tokens);
if(err) {
res.json({err: auth});
} else {
if(tokens) {
var user = new AdwordsUser({
developerToken: config.Adwords.DEVELOPER_TOKEN,
userAgent: 'Neefla Technologies Ltd.',
clientCustomerId: clientCustomerId,
client_id: config.Adwords.CLIENT_ID,
client_secret: config.Adwords.CLIENT_SECRET_KEY,
refresh_token: config.Adwords.CLIENT_REFRESH_TOKEN,
access_token: token.access_token
});
//return auth object
res.json({user: user});
//res.json({token: token});
} else {
res.json({token_err: err});
}
}
});
});
But access token is null.
What am I wrong?
Thanks.
Is there a way to use the LanguageSearchParameter when using the TargetingIdeaService?
I went through the API doc but I keep getting an "Unmarshalling Error: cvc-complex-type.2.4.a" error.
Here is my selector:
let selector = {
searchParameters: [
{
attributes: {'xsi:type': 'RelatedToQuerySearchParameter'},
queries: ['test']
},
{
attributes: {'xsi:type': 'LanguageSearchParameter'},
languages: [{id: 1000}]
}
],
ideaType: 'KEYWORD',
requestType: 'IDEAS',
requestedAttributeTypes: ['KEYWORD_TEXT'],
paging: {startIndex: 0, numberResults: AdwordsConstants.RECOMMENDED_PAGE_SIZE},
}
I can't seem to see what's wrong especially since the request is identical to the one sent with the official PHP or Python client.
Links to Google Adwords API doc:
https://developers.google.com/adwords/api/docs/reference/v201607/TargetingIdeaService.LanguageSearchParameter
https://developers.google.com/adwords/api/docs/reference/v201607/TargetingIdeaService.Language
Hello!
I'm trying to create ExpandedTextAd following official python examples.
So far i've created such method for creating ad:
function createAdGroupAd(adGroup, appearance) {
const newAd = {
'xsi:type': 'AdGroupAd',
adGroupId: adGroup.id,
ad: {
'xsi:type': 'ExpandedTextAd',
headlinePart1: appearance.headLine1,
headlinePart2: appearance.headLine2,
description: appearance.linkDescription,
path1: appearance.path1,
path2: appearance.path2,
finalUrls: [
'http://www.example.com/cruise/space/',
'http://www.example.com/locations/mars/'
]
},
status: 'PAUSED'
}
const adOperation = {
operator: 'ADD',
operand: newAd
}
return adGroupAdService.mutateAsync({ operations: [adOperation] })
}
Where adGroup is sucessfully created adGroup.
But i'm getting such error:
Error: soap:Client: Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was found starting with element 'finalUrls'. No child element is expected at this point.
Any idea what can it be?
hi, i am try create a shopping campaign but i get this error:
'Unmarshalling Error: cvc-type.2: The type definition cannot be abstract for element settings. '
When I read the older problems add to my code the Type parameter but now I get the following error:
Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element \'budget\'
Any idea of the problem?
there go my code:
const OPERATOR = {ADD:'ADD',REMOVE:'REMOVE',SET:'SET'};
let campaignService = user.getService('CampaignService','v201702')
let budgetService = user.getService('BudgetService','v201702');
function createShoppingCamp(){
var MERCHANT_ID = xxxxxxxx;
createBudget(function (b) {
var shoppingCamp = {
name : 'SHOPPING Camp ' + Date.now() ,
status : 'PAUSED',
settings : {
merchantId:MERCHANT_ID,
salesCountry:'US',
campaignPriority:0,
enableLocal:true,
'xsi:type': 'ShoppingSetting'
},
advertisingChannelType : 'SHOPPING',
budget: {
budgetId: b.budgetId // this is a valid budget id.
},
biddingStrategyConfiguration : {biddingStrategyType: 'MANUAL_CPC'}
};
var newShoppingCampOp = {
operator : OPERATOR.ADD,
operand : shoppingCamp
};
campaignService.mutate({operations: [newShoppingCampOp]}, (error, result) => {...})
})
}
createShoppingCamp();
I appreciate the help!
Where do I pass the access_token
I receive from getAccessTokenFromAuthorizationCode()
?
I keep getting AuthorizationError.USER_PERMISSION_DENIED
when calling campaignService.get()
.
I'm trying to establish my first API call to AdWords and pull some campaign data. Here is the code that throws the permission error.
let auth = new AdwordsAuth({
client_id: 'xxx',
client_secret: 'xxx'
}, 'http://localhost:3000/adwords/auth' /** insert your redirect url here */);
app.get('/', (req, res) => {
res.redirect(auth.generateAuthenticationUrl());
})
app.get('/adwords/auth', (req, res) => {
auth.getAccessTokenFromAuthorizationCode(req.query.code, (error, tokens) => {
console.log('tokens...');
console.logFull({ error, tokens });
//save access and especially the refresh tokens here
let user = new AdwordsUser({
developerToken: 'xxxx', //your adwords developerToken
userAgent: 'xxx', //any company name
clientCustomerId: 'xxxx', //the Adwords Account id (e.g. 123-123-123)
client_id: 'xxxx', //this is the api console client_id
client_secret: 'xxxx',
refresh_token: tokens.refresh_token,
});
let campaignService = user.getService('CampaignService', 'v201702');
let selector = {
fields: ['Id', 'Name'],
ordering: [{field: 'Name', sortOrder: 'ASCENDING'}],
paging: {startIndex: 0, numberResults: AdwordsConstants.RECOMMENDED_PAGE_SIZE}
};
campaignService.get({ serviceSelector: selector }, (error, result) => {
console.log(result.body);
res.send(result)
});
})
});
function createFeedItems(feed) {
var feedItemService = AdWordUser.getService('FeedItemService', 'v201609');
var feedId = feed.feedId;
var attributes = [{
feedAttributeId: "1",
stringValue: "testname"
},{
feedAttributeId: "2",
stringValue: "testprice"
},{
feedAttributeId: "3",
stringValue: "testdate"
}];
// create feedItem with created attributes
var feedItem = createFeedItem(feedId, attributes, target);
let op = {
operator: "ADD",
operand: feedItem //filling in null returns same error
}
try {
feedItemService.mutate({ operations: [op] }, feedItemsCreated);
}catch(error){
console.log(error);
}
}
So i am debugging this for the whole day but it always returns the following error:
node_modules/soap/lib/wsdl.js:1924
WSDL.prototype.findChildSchemaObject = function(parameterTypeObj, childName) {
^RangeError: Maximum call stack size exceeded
As you can see even if i fill in null it returns the callstack error.
hi i tried to create a campaign, budget ad etc..
problem is even after using php library as a reference i cant manage to do so.
any where i can see examples?
i have installed in meteor project and deployment in heroku and using the buildpack is https://github.com/AdmitHub/meteor-buildpack-horse getting SyntaxError: illegal character
i have been trying for 2 days to be able to create Feed Items from api but without success. it looks like feed item format is not correct. the error that i am getting currently is :
if ((childNsURI.match("http://schemas.microsoft.com") === null) || isInsideSchemaMS) {
^ RangeError: Maximum call stack size exceeded
and below is my code...
` let attributes = [
{feedAttributeId:1,stringValue:"my awesome site "},
{feedAttributeId:5,stringValues:["http://www.google.com/about"]}
];
let feedItem = {
feedId:55897084,//site link feed
status: 'UNKNOWN',
attributeValues: attributes
};
let feedOperation = {
operator: 'ADD',
operand: feedItem
};
try {
feedItemService.mutate({operations:[feedOperation]}, (error, Result) => {
console.log("done");
console.log(Result);
console.log(error);
});
}catch(err){
console.log(err);
}`
please kindly help
I need create a new campaign, i am new with this api. Can give me a sample of how to do this please?
Thank you so much
Hi,
How could I change the dateRangeType in AdwordsReport?
It seems like no matter what value I pass it sets to 'CUSTOM_DATE'.
Thank you.
This is such a valuable library. Do you want help maintaining it?
does node-adwords support it?,
Moreover, any good suggest to handle microAmount value??
I am willing to get the normal value instead of that.
Hello Chris,
Does your TargetIdeaService can add NetWorkSearchParameter?
Thanks!
Best Regards,
maran
Does it support AWQL?
Hello all,
I am trying to create a new campaign with the API, and I get this error:
"Client: Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'budget'......."
I understand from other issues that this problem is about the order of the object.
this is the object that I am trying to use:
{
operations: [{
operator: 'ADD',
operand: {
name: "masho",
status: "PAUSED",
advertisingChannelType: 'SEARCH',
biddingStrategyConfiguration: {
biddingStrategyType: 'MANUAL_CPC'
},
budget: {
budgetId: 2085008246 //this is a budgetId that i create before (tried as string and as a number) .
}
}
}]
}
Can anyone tell me what is the problem? I am trying to solve this for hours.
And also, there is anyone knows where can I find an example for every request order?
thanks,
Shlomi
Hi,
Could you help me, how I can send a batch package back to the url I get through "batchJobService"?
Thx,
Oppkij
Hello, just a heads up. "auth" in "The main adwords user object follows the auth parameters of the PHP library." links to a 404.
Thanks
Looking for a way to implement segmentatión.
We want to get daily reports in a range of dates.
Trying to use segments:
https://developers.google.com/adwords/api/docs/appendix/reports/campaign-performance-report#date
But no find documentation for nodejs.
serviceSelector for CampaignService version v201708 look like this:
{ fields: ['Id', 'Name'], ordering: [{field: 'Name', sortOrder: 'ASCENDING'}], paging: {startIndex: 0, numberResults: AdwordsConstants.RECOMMENDED_PAGE_SIZE}, predicates: [{ field: 'CampaignId', operator: 'IN', values: [623541753] }] }
and get error:
Error: soap:Client: Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was found starting with element 'predicates'. No child element is expected at this point.
npm install node-adwords --save
npm WARN deprecated [email protected]: use uuid module instead
[email protected] install c:\xxx\node_modules\ursa
node-gyp rebuild
c:\xxx\node_modules\ursa>if not defined npm_config_node_gyp (node "c:\xxx\nvm\v7.0.0\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuil
d ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
ursaNative.cc
win_delay_load_hook.cc
LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win32\lib\libeay32.lib' [c:\xxx\node_modules\ursa\build\ursaNative.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit c:\xxx\nvm\v7.0.0\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" c:\xxx\nvm\v7.0.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd c:\xxx\node_modules\ursa
gyp ERR! node -v v7.0.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
c:\xxx
`-- [email protected]
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\ursa):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Could you add option to use google OAuth client?
Im trying to create new CrmBasedUserLists but I am having trouble on getting the right Objects for doing this.
So far I have:
var nodeAdwords = require("node-adwords")
const AdwordsConstants = require('node-adwords').AdwordsConstants;
const AdwordsUser = require('node-adwords').AdwordsUser;
const CrmBasedUserList = require('node-adwords').CrmBasedUserList;
`function(user) {
let userListService = user.getService('AdwordsUserListService', 'v201802')
console.log(userListService)
let customAudience = new CrmBasedUserList ({
'xsi:type' : 'CrmBasedUserList',
name: 'Test CRM Audiencia',
description: 'Audienca creada por Node.js',
membershiplifespan: '90L',
uploadkeytype: 'CONTACT_INFO'
})
let listOperation = {
operator: 'ADD',
operand: customAudience
}
return userListService.mutateAsync({ operations: [listOperation] })
}`
I dont know If Im missing a require, or if the anme of the Object Im ussing is wrong or does not exist on the SDK.
Thanks!
Once the user did OAuth, I want to know the user's client customer id using refresh/access token. I am able achieve this in Java client lib like below.
AdWordsServicesInterface adWordsServices = AdWordsServices.getInstance();
CustomerServiceInterface customerServiceInterface = adWordsServices.get(session, CustomerServiceInterface.class);
Customer[] customers = customerServiceInterface.getCustomers();
Please guide me how do I do it as I am new to node.js
Hi,
Im having trouble finding out how to generate a refresh token, any idea where i can do this? I already have my client id and client secret setup.
File: adwords/auth.js
in line 2:
var OAuth2 = google.auth.OAuth2;
In fact there should be
var OAuth2 = google.google.auth.OAuth2;
fixed via #50
From adword API Documentation:
To include zero impressions in your report output, set the includeZeroImpressions HTTP header to true.
When set to true, reports will not exclude any rows based on metric values, and will include those with zero impressions.
But how can I set includeZeroImpressions HTTP header?
I have the following code:
function getAdGroup (req, res) {
let user = new AdwordsUser(adwordsConfig)
let { campaignId } = req.body
let adGroupService = user.getService('AdGroupService', 'v201609')
let selector = {
fields: ['Id', 'Name'],
ordering: [{field: 'Name', sortOrder: 'ASCENDING'}],
predicates: [{field: 'CampaignId', operator: 'EQUALS', values: [Number.parseInt(campaignId)]}],
paging: {startIndex: 0, numberResults: AdwordsConstants.RECOMMENDED_PAGE_SIZE}
}
adGroupService.get({serviceSelector: selector}, (error, result) => {
if (error) {
return res.status(404).json(error)
}
return res.status(200).json(result)
})
}
Getting this error:
"Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was found starting with element 'predicates'. No child element is expected at this point."
Anyone knows how to add predicates to selectors? I have tried using variations in the key: predicate/predicates and assigning array and non array values.
Any help is really appreciated.
Does the refresh token always have to be refreshed before it expires?
I am trying to refresh a token where the expiry_date
has passed like so
console.log({ refreshToken });
auth.refreshAccessToken(refreshToken, (error, newTokens) => {
if (error) {
console.log(error);
} else {
console.log(newTokens);
}
});
but get this error
{ refreshToken: '1/RXdGaAPOwhcye1-DNbZJYlz67ArETtPYBRnexxxxxxx' }
Exception while invoking method 'xxx' Error: No refresh token is set.
at OAuth2Client.refreshAccessToken (/xxx/node_modules/google-auth-library/lib/auth/oauth2client.js:199:14)
at AdwordsAuth.refreshAccessToken (/xxx/node_modules/node-adwords/adwords/auth.js:52:27)
The refreshToken
is being passed, not sure why it says that it is not being set. I don't get this issue if I call this method before it expiry_date
.
Given the below selector:
{
selector: {
campaignEstimateRequests: [
{
adGroupEstimateRequests: [
{
keywordEstimateRequests: [
{
keyword: {
text: 'mars cruise',
matchType: 'BROAD'
}
},
{
keyword: {
text: 'cheap cruise',
matchType: 'BROAD'
}
}
],
maxCpc: {
microAmount: 1000000
}
}
],
criteria: [
{
'xsi:type': 'cm:Language',
id: 1000
},
{
'xsi:type': 'cm:Location',
id: 2840
}
]
}
],
platformEstimateRequested: true
}
}
Notice the cm:
prefix in the xsi:type
of criteria, this is necessary because the namespace is different. If this is removed the request fails with the following error:
soap:Client: Unmarshalling Error: cvc-elt.4.2: Cannot resolve 'Language' to a type definition for element 'criteria'.
I found the problem by observing the namespaces that were being sent. I think the library should be able to figure out the namespace automatically, thoughts?
I'm attempting to upload an image to use as a display ad. Below is my function, which when called returns an error with message "soap:Client: [MediaError.UNSUPPORTED_TYPE @ media[0]]". I believe the structure I am using for media
and operations
is incorrect, but I am not sure what to use. I have tried many things and the docs haven't been very helpful. Any help is appreciated.
const mediaService = user.getService('MediaService');
const uploadImage = async (url) => {
return new Promise((resolve, reject) => {
const media = {
type: 'IMAGE',
urls: {
key: 'FULL',
value: url
}
};
const operations = {
media
};
mediaService.upload(operations, (err, result) => {
if (err) {
console.error(err);
reject(err);
}
resolve(result.value);
});
});
};
Link to docs that identify IMAGE
as an acceptable value of type
: https://developers.google.com/adwords/api/docs/reference/v201802/AdGroupAdService.Media
Hello Chris,
Can add OfflineDataUploadService?
Thanks!
Best Regards,
Choi
Hello,
Congratulations for this great lib.
I'm having trouble to iterate thru the pages.
let campaignService = user.getService('CampaignService', 'v201710')
//create selector
let selector = {
fields: ['Id', 'Name'],
ordering: [{field: 'Name', sortOrder: 'ASCENDING'}],
paging: {startIndex: 0, numberResults: 500}
}
campaignService.get({serviceSelector: selector}, (error, result) => {
console.log(error, result);
})
Using this code, in case of I have more than 500 campaigns, How could I iterate to next page?
Thanks!
I'm having difficulties implement a new campaign, following original libraries guidelines and trying o use your repo:
PHP AddCampaign
Python AddCampaign
API reference for budget service
I cannot resolve budgetService. mutate()
following those examples. My code is the following:
let budgetService = user.getService('BudgetService', 'v201609')
let budget = {
'name': 'Some other budget #d47da42a-b6ab-4486-8320-8acc0ab80f24',
'amount': {
'ComparableValue.Type':'Money',
'microAmount': '10000'
},
'deliveryMethod': 'STANDARD'
}
let budget_operations = [{
'operator': 'ADD',
'operand': budget
}]
let result = budgetService.mutate(budget_operations);
In Python, mutate result is the following:
(BudgetReturnValue){
ListReturnValue.Type = "BudgetReturnValue"
value[] =
(Budget){
budgetId = 979538539
name = "Alternate budget #08f38976-d31f-4f1e-9f4d-018b4cfb72da"
amount =
(Money){
ComparableValue.Type = "Money"
microAmount = 30000
}
deliveryMethod = "STANDARD"
isExplicitlyShared = True
status = "ENABLED"
},
}
Using this code returns an error:
result = budgetService.mutate(budget_operations);
RangeError: Maximum call stack size exceeded
at String.substring (native)
at splitQName (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:64:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1937:20)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
at WSDL.findChildSchemaObject (/Users/gabrielParrable/localDev/node-adwords-dev/node_modules/soap/lib/wsdl.js:1945:19)
What am I missing?
HI
I tried to get google adwords report with node-adwords, and arguments like developerToken,userAgent,clientCustomerId,client_id,client_secret,refresh_token are correct in my MCC account.
I am an administrator in MCC account and has a high-level credentials.
Howerev I still met the error AuthorizationError.SERVICE_ACCESS_DENIED.
I want to know why it is. Please help me out. Thanks.
Hello, I upgraded from v201710 to v201806 using version: 201806.0.1
When doing a request to retrieve the customers I receive:
"{"name":"externalError","message":"Text data outside of root node.\nLine: 0\nColumn: 90\nChar: l","statusCode":400}"
Request:
`let user = new AdwordsUser({
developerToken: adwordsDeveloperToken,
client_id: adwordsClientId,
client_secret: adwordsClientSecret,
access_token: accessToken
});
let customerService = user.getService('CustomerService', 'v201806');
let selector = {
fields: ['CustomerId', 'Name'],
ordering: [{field: 'CustomerId', sortOrder: 'ASCENDING'}],
paging: {startIndex: 0, numberResults: AdwordsConstants.RECOMMENDED_PAGE_SIZE}
};
return new Promise( (resolve, reject) => {
customerService.getCustomers({serviceSelector: selector}, (error, result) => {
if (error) {
reject(error);
}
resolve({data: result});
})
})`
Then I downgraded to 201802.3.0, this version does work as expected.
What could be the issue?
Thanks,
Patrick
I tried to get list of existing languages with ConstantDataService but got nothing. It doesn't return error nor result. What am I doing wrong?
`const AdwordsUser = require('node-adwords').AdwordsUser
const adwordsApiUser = new AdwordsUser(config.get('services.adwords.user')) //correct user data
const constantDataService = adwordsApiUser.getService('ConstantDataService', config.get('services.adwords.version'))
constantDataService.getLanguageCriterion((err, result) => console.log(err, result)`
I don't see this in the documentation, but is offline conversion tracking possible with this api?
https://developers.google.com/adwords/api/docs/guides/conversion-tracking
HI,
Is there a way to get the the complete SOAP request for debugging?
Hi I am getting stuff to work but the selectors for the feed is not working. It just responds:
body: '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element \'feedname\'. One of \'{"https://adwords.google.com/api/adwords/cm/v201609":feedId, "https://adwords.google.com/api/adwords/cm/v201609":feedName, "https://adwords.google.com/api/adwords/cm/v201609":feedStatus, "https://adwords.google.com/api/adwords/cm/v201609":feedAttributes}\' is expected. </faultstring></soap:Fault></soap:Body></soap:Envelope>' },
function createCustomizerFeed(feedName) {
var adCustomizerFeedService = AdWordUser.getService('AdCustomizerFeedService', 'v201609');
let nameAttr = {
name: "NameTest"
}
let Feed = {
feedname: "TestName",
feedattributes: [nameAttr]
}
let FeedOperation = {
operand: Feed,
operator: "ADD"
}
adCustomizerFeedService.mutate({ operations: [FeedOperation] }, (error) => {
if (error) {
console.log(error);
} else {
console.log("feed created!");
}
});
}
Am I missing something ? I looked at the following link for creating the feed
Hello there!
Thanks for sharing the library :)
I'm trying to fetch an accounts list from my customers, but I'm receiving this error upon every request to the Adwords API:
.../node_modules/soap/lib/client.js:275
var eid = options.exchangeId || uuid.v4();
^
TypeError: uuid.v4 is not a function
Do you have any idea of how can I solve this? Tried changing my uuid
version on my packages.json
but didn't do the trick, still getting it.
Having elements outside of the normal adwords order causes issues with the sdk / api.
Test Case
//this will work
let operation = {
operator: 'ADD',
operand: {
....
}
}
//this will not work
let operation = {
operand: {
....
},
operator: 'ADD',
}
We might need to read the wsdl to determine the order of elements or something. Not really sure how to solve this one as dynamically as possible.
For now, having the elements in the correct order is the workaround.
Hi there,
First off, thanks for the great work on this. I'd appreciate it if you could publish a new release containing 506f638 to npm, as we're looking to run some reports using the new date range functionality.
Installing from master for now, but an npm release would be great.
I have been trying to get this code to work but i have no idea why its still not working, could you please help me out?
var TargetingIdeaService = user.getService('TargetingIdeaService', 'v201609')
//create selector
var selector={
SearchParameter:[{RelatedToQuerySearchParameter:'Games'}],
IdeaType:'KEYWORDS',
requestType:'IDEAS',
requestedAttributeTypes: ['TARGETED_MONTHLY_SEAsRCHES', 'KEYWORD_TEXT'],
paging: {startIndex: 0, numberResults:20}
}
TargetingIdeaService.get({serviceSelector: selector}, function (error, result) {
console.log(error, result);
})
Kudos for a good library. I'm trying to create a block IP criterion for a campaign and it's failing with the following error:
"Fault": { "faultcode": "soap:Client", "faultstring": "Unexpected wrapper element mutate found. Expected {https://adwords.google.com/api/adwords/cm/v201609}mutate." }
I'm following the PHP library as advised and as a matter of fact have a working implementation of the same functionality in PHP with the one difference - in PHP I'm instantiating a NegativeCampaignCriterion which I'm not able to do here since the lib is using a standard object notation. This is why this looks like an issue with the library itself.
These are the methods/entities used:
Here's my implementation:
blockIp(accountNumber,campaignId,ip) {
var _this = this;
return _this.configure().then(function onApiConfigured() {
// prepare
var user = _this.prepareUser(accountNumber);
var service = user.getService('CampaignCriterionService', _this.gapi.version);
// build
var criterion = {
campaignId: campaignId,
isNegative: true,
criterion: { ipAddress: ip }
};
var operation = { operator: 'ADD', operand: criterion };
// wrap the call in a promise
return new Promise(function executeBlockIp(resolve,reject) {
service.mutate([operation], function onBlockIpDone(err, result) {
if(err) {
reject({ message: 'Google API error', error: err });
}
else {
resolve(result);
}
});
});
});
}
Please note that _this.prepareUser(accountNumber);
is working in other functionality implementations so there are no hidden problems, just the fact I seem to be failing at implementing this operation.
Can you advise? Needless to say I will appreciate a quick reply and assistance.
CustomerSyncService giving me error 'AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED' even though I am passing client customer id. I am using CustomerSyncService get method to get changed entities. My selectors are dateTimeRange and campaignIds
The module could pass ungzipped response when the format mentioned is: GZIPPED_CSV
or GZIPPED_XML
.
i am trying to 'node adwords' on meteor framework, then type error in browser fs.readdirSync is not a function
hi brother thanks for the package. any chance you are attaching a small example of how to use
this service ? i have looked at the php api example like here but couldn't get it to work.
$offlineConversionService = $user->GetService("OfflineConversionFeedService", API_VERSION);
$operations = array();
foreach ($conversions as $conversion) {
$gclid = $conversion["gclid"];
$convDate = date("Ymd His", $conversion["date"]);
$convValue = isset($conversion["value"]) ? $conversion["value"] : 0;
$offlineConversion = new OfflineConversionFeed(
$gclid, $conversionName, $convDate, $convValue
);
$operations[] = new OfflineConversionFeedOperation($offlineConversion, "ADD");
}
$result = $offlineConversionService->mutate($operations);
thank you very much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.