Comments (4)
from openrtb.
Oh, I definitely missed the CUSTOM_...
bit, thanks for explanation.
Though looks that my question is about something other - the Macro JSON format itself. And I'd better prefer to double-confirm it to be 100% sure I'm getting it right (docs are somewhat confusing).
So looks like this is the way to marshal the Macro object:
{
"TIMESTAMP": "2018-10-14"
}
Which:
- is provided in BidResponse example JSON;
- so meant to be marshaled in this particular way by 3.0 spec;
- and it would result in
${CUSTOM_TIMESTAMP}
to be replaced with2018-10-14
in prepared ad snippet/URLs.
Right?
I have some concerns about this (the format itself and then how it's explained in spec).
- IMO, this format is inconvenient for typed languages - you usually have to declare classes/structs with predefined set of object keys for proper marshal/unmarshal. Having dynamic keys usually requires more lines or more tricky code for proper processing (unless you switch to less performant/GC-heavy map/dictionary types).
Roughly:
{
"key": "TIMESTAMP",
"value": "2018-10-14",
"ext": {
"custom": "data"
}
}
Is way more easier to parse (or, better said, not to "parse", but to "model" - make class for it) than:
{
"TIMESTAMP": "2018-10-14",
"ext": {
"custom": "data"
}
}
Yep, I get that "convenient" way is much less compact than having dynamic keys (as suggested in spec), but still - clearer and easier to use (especially with "key"
and "value"
shortened to just "k"
and "v"
).
Also, for example, in Bid object doc Macro is used as object array
.
Which, to be honest, would look weird (at least to me):
[
{ "TIMESTAMP": "2018-10-14" },
{ "FOO": "BAR" },
{ "BAZ": "QUX" }
]
Like, why pack these into array, if we could just have:
{
"TIMESTAMP": "2018-10-14",
"FOO": "BAR",
"BAZ": "QUX"
}
(which would be even more compact)
That's another reason of why I was confused with Macro doc (the object array
thingy).
Anyway, I don't think that's going to change (at least not after 3.0 hit the BETA status), so consider this just a way-too-late developer's rant 🙂
- This dynamic-key format is not very obvious from the doc:
Attribute | Type | Definition |
key | string; required | Name of a buyer specific macro. |
value | string | Value to substitute for each instance of the macro found in markup. |
ext | object | Optional demand source specific extensions. |
As a developer, "used" to other OpenRTB 3.0 object docs, I'm expecting Macro JSON to look like this:
{
"key": "TIMESTAMP",
"value": "2018-10-14",
"ext": {
"custom": "data"
}
}
And not like this:
{
"TIMESTAMP": "2018-10-14",
"ext": {
"custom": "data"
}
}
I'd "vote" to add some explanation / note / WARNING that it's the second JSON example and not the first. Like, right in Macro object section, and not just in Examples (which itself is a bit sloppy - I mean #9). Though I can't think of a better way than including macro JSON example right into Macro object section (which would contradict other object docs though).
from openrtb.
from openrtb.
Oh, that's awesome then!
In this case Macro object doc is totally fine (CUSTOM_...
explanation bits are up to you).
Example JSON - will PR the fix in ~ 8-9h. Unless it's fixed in master before that 🙂
from openrtb.
Related Issues (20)
- Wait, isn't segtax supposed to be a string?
- Stricter versioning? HOT 1
- Ada Issue
- Per-Impression Transaction IDs for multi-impression bid requests
- Mock up data for openrtb
- Missing GPP Extension? HOT 1
- Filename issue
- <script async src="https://fundingchoicesmessages.google.com/i/pub-5328552429034223?ers=1" nonce="8v3euzFMkRnwVfHrCzv5eA"></script><script nonce="8v3euzFMkRnwVfHrCzv5eA">(function() {function signalGooglefcPresent() {if (!window.frames['googlefcPresent']) {if (document.body) {const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe);} else {setTimeout(signalGooglefcPresent, 0);}}}signalGooglefcPresent();})();</script> HOT 2
- This picture is broken
- DSA example not fully correct
- DSA Query Params HOT 2
- Zeros should not be meaningfull values
- Logical expression on restrictions
- Restriction at placement level
- Trust.id HOT 3
- trustid_gln_result.png
- SupplyChain Object tamper-prevention HOT 5
- Extended Content IDs community extension
- segtax review and field usage mixup concerns HOT 4
- Add the Global Privacy Control signal to the OpenRTB extensions 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 openrtb.