Skip to content

Instantly share code, notes, and snippets.

@kylebakerio
Created August 4, 2016 22:13
Show Gist options
  • Save kylebakerio/d8af69052ef061e6fb1796a857e3bd38 to your computer and use it in GitHub Desktop.
Save kylebakerio/d8af69052ef061e6fb1796a857e3bd38 to your computer and use it in GitHub Desktop.
APLE (Ad PLacement Engine) flow diagram
```sequence
client->IZ: [Quote, PlacementGroup]
IZ->Charm: [Quote, PlacementGroup]
Charm->CharmDB: [get Partners of type 'aggregator', rules for each]
CharmDB-->Charm:
Note left of Charm: make payload from those who pass rules
Charm->APE: [payloads to fan out]
Note left of Charm: in the meantime:
Note left of Charm: for each Placement in Placement Group,
Note left of Charm: for each Ad in Placement which passes rules
Charm->CharmDB:
CharmDB-->Charm: [Rules for Ads in Placements in PlacementGroups]
Note left of Charm: build up response object, ads per placement,
Note left of Charm: sorted by CPC * CTR * RULES * WEIGHT,
Note left of Charm: containing placement specific styling
APE-->Charm: [aggregator ads]
Note left of Charm: inject aggregator ads sorted by CPC * CTR * WEIGHT
Charm-->IZ: [ad response]
Note left of IZ: adds replaces_carrier_id to ads
IZ-->client: [ads]
Note left of client: as each ad renders,
Note left of client: fires tracking pixel impression
client->IZ: [QuoteID, AdID, PlacementID, CPC]
```
> Written with [StackEdit](https://stackedit.io/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment