nanek / example-dfp-line-item-generator Goto Github PK
View Code? Open in Web Editor NEWExample code to help you quickly and systematically create line items in Google's Doubleclick for Publishers
License: MIT License
Example code to help you quickly and systematically create line items in Google's Doubleclick for Publishers
License: MIT License
I've gotten this fairly cryptic error when running scripts that hit the DFP API ~400+ times
creating line items failed Error: undefined: undefined
at WSDL.xmlToObject (/Users/admin/line-item-generator/node_modules/node-google-dfp/node_modules/soap/lib/wsdl.js:1400:19)
After some digging, I uncovered this error message and figured out that it's because the generator makes multiple requests for custom criteria values when preparing line items (each of which is done individually and happens quickly).
I found a good solution to be to rely on the caching mechanism more. The function first looks up the value in the local store. If it doesn't find it, then it queries DFP for all the values that match the keyid passed in. It then stores all of those in the local store and looks up the initial value again.
Please let us know here if you're having troubles getting started!
This was brought up by @jononomo in #1.
README says the following:
Go to https://console.developers.google.com/project. Make a project for your app and then go to https://console.developers.google.com/project/your-app/apiui/credential. Click Download JSON. Save the file as local/application-creds.json.
but… I don't see a “Download JSON” link or button to click
Copied from nanek/node-google-dfp-wrapper#24 by @brianibok
Hi All,
Getting the error below when I try to run the script to generate the line-items:
node scripts/create-line-items.js --order ORDER_NAME --start 1 --end 1
Error:
Progress [=-] 50% 0.0screating line items failed
because Error: soap:Server: [PublisherQueryLanguageSyntaxError.UNPARSABLE @ Unable to parse query: 'Where '
Syntax error at line 0, column 0.]
However no modifications were made to the script
@nanek @mmilleruva @CarsonBanov
Based on the discussion in #1 and #29, and previous discussions we've had, does it make more sense for prebid to be the default branch? If you think most publishers are looking to generate line items for prebid, as opposed to for individual header bidders, we could do this. The prebid branch is also simpler (and the code is better thanks to @nanek).
Errors from the API are not properly thrown back to the application code. They come in as strings in the body of the response like <soap-fault>Error!</soap-fault>
.
Maybe the best way of handling this would be for lib/user
when it executes a function from a service, to check the resulting string for an error and if it finds one, to construct a javascript error and throw it.
I got around it by commenting out the require statement, and it worked fine.
Hi all,
I was able to set up my order correctly, but when I tried setting up my line items I couldn't get any value for argv.offset.
If you notice, this is the undefined
part of the order name. Also, how are you able to associate the line items with the order? I'm working off the granular-prebid
branch
When I call createLineItems with the object below, I get a soap error. I tried using the code directly from the createCampaign example, but ran into errors straight away with attributes of LineItem that don't exist. I went through the wsdl docs and changed up the LineItem, but still... Any help you could give sure would be appreciated...
[
{
"orderId": 428533037,
"name": "Tester",
"externalId": 55,
"startDateTime": {
"date": {
"year": 2016,
"month": 3,
"day": 16
},
"hour": 19,
"minute": 0,
"second": 0,
"timeZoneID": "America/Chicago"
},
"endDateTime": {
"date": {
"year": 2016,
"month": 3,
"day": 30
},
"hour": 19,
"minute": 0,
"second": 0,
"timeZoneID": "America/Chicago"
},
"creativeRotationType": "WEIGHT",
"lineItemType": "STANDARD",
"allowOverbook": true,
"skipInventoryCheck": true,
"primaryGoal": {
"goalType": "LIFETIME",
"unitType": "IMPRESSIONS",
"units": 122
},
"targeting": {
"inventoryTargeting": {
"targetedPlacementIds": 3441557
}
},
"costType": "CPM",
"creativePlaceholders": [
{
"size": {
"width": 728,
"height": 90,
"isAspectRatio": false
}
}
],
"costPerUnit": {
"currencyCode": "USD",
"microAmount": 2000000
}
}
]
ERROR:
<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 'costType'. One of '{"https://www.google.com/apis/ads/publisher/v201602":creativeTargetings}' is expected. </faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
My createOrders call works flawlessly whenever I pass my object without the externalOrderId, like:
var args = { orders: [{
name: 'My Order Name',
advertiserId: 86999999,
traffickerId: dfpTraffickerID
}]};
However, I get a soap error when I pass the externalOrderId, like:
var args = { orders: [{
name: 'My Order Name',
advertiserId: 86999999,
traffickerId: dfpTraffickerID,
externalOrderId: '#100043'
}]};
The error is below and I sure would appreciate any help you could give. I've tried using v201505, v201511 and v201602.
<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 'externalOrderId'. One of '{"https://www.google.com/apis/ads/publisher/v201602":secondaryTraffickerIds, "https://www.google.com/apis/ads/publisher/v201602":salespersonId, "https://www.google.com/apis/ads/publisher/v201602":secondarySalespersonIds, "https://www.google.com/apis/ads/publisher/v201602":totalImpressionsDelivered, "https://www.google.com/apis/ads/publisher/v201602":totalClicksDelivered, "https://www.google.com/apis/ads/publisher/v201602":totalViewableImpressionsDelivered, "https://www.google.com/apis/ads/publisher/v201602":totalBudget, "https://www.google.com/apis/ads/publisher/v201602":appliedLabels, "https://www.google.com/apis/ads/publisher/v201602":effectiveAppliedLabels, "https://www.google.com/apis/ads/publisher/v201602":lastModifiedByApp, "https://www.google.com/apis/ads/publisher/v201602":isProgrammatic, "https://www.google.com/apis/ads/publisher/v201602":programmaticSettings, "https://www.google.com/apis/ads/publisher/v201602":appliedTeamIds, "https://www.google.com/apis/ads/publisher/v201602":lastModifiedDateTime, "https://www.google.com/apis/ads/publisher/v201602":customFieldValues}' is expected. </faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Also, what would be the best way to log the soap requests as they're sent? I'd like to get a look at them going out to figure out what's going wrong...
Thanks a ton man,
Ferg
Hi All,
Trying to create an order using the script and everything works fine up until I run the create order command and get the error below:
getTokens Error invalid_grant
.../example-dfp-line-item-generator/node_modules/node-google-dfp/lib/DfpUser.js:69
throw error;
^
Any ideas?
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.