This is not an officially supported Google product.
Teams from across Google, including Ads teams, are actively engaged in industry dialog about new technologies that can ensure a healthy ecosystem and preserve core business models. Online discussions (e.g. on GitHub) of technology proposals should not be interpreted as commitments about Google ads products.
This code provides a server that can run JavaScript bidding and ad scoring functions, as specified in the FLEDGE explainer. The idea is to experiment with moving evaluation of JS from on-device to a server instead.
Discussions of how to add trust to the server are not covered here, see.
Bidding functions are currently statically configured in a
server/sample_configuration.yaml
file that gets built into the container.
Edit the file to add or change the bidding function that Aviary should be able
to run, for example:
biddingFunctions:
squaring: |
(function(inputs) { return inputs.perBuyerSignals.contextualCpm * return inputs.perBuyerSignals.contextualCpm; })
In order to be able to build and run Aviary locally, a number of tools need to be installed on the local machine.
-
Run
setup.sh
convenience script to set up the local development environment. It performs the following steps:
An Aviary server is built as a Docker container.
One can build it with:
bazelisk run //server:aviary
or, if you're not using Bazelisk:
bazel run //server:aviary
You can run Aviary locally with Docker and bind to a chosen local HTTP port:
export PORT=8080; docker run -p ${PORT}:${PORT} -e PORT=${PORT} bazel/server:aviary
To test that Aviary is running, we can send a request to invoke a simple bidding
function that doubles the value from perBuyerSignals
:
curl -X POST http://localhost:8080/v1alpha/adAuctions:computeBid -d '{"biddingFunctionName": "doubling","input": {"perBuyerSignals": {"contextualCpm": 1.23}}}' -H "Content-type: application/json"
{
"bid": 2.46
}
This code is published so that it‘s possible for anyone to re-run the experiments that we’re doing. This code will not be supported once the experimentation is complete.