Skip to content

Commit 01d3479

Browse files
authored
Bugfix/home docs (#626)
* demo docs fixes : - fix issue #624 - fix issue #623 - fix issue #622 - fix issue #621 Documentation Fixes: The PR resolves multiple documentation issues by fixing relative file paths and URLs in the markdown files. It also updates image links to use relative paths instead of absolute URLs. Docusaurus Configuration: The Docusaurus configuration is updated to throw an exception when Markdown links are broken, ensuring link integrity. The trailingSlash option is enabled to add trailing slashes to URLs. Nginx Configuration: The Nginx configuration is strengthened by upgrading Nginx to version 1.27.5-alpine and adding directives for security and optimization. The configuration file is now directly copied to /etc/nginx/nginx.conf instead of using a template. Docker Compose Update: The docker-compose.yml file is updated to use the newer Nginx image version 1.27.5-alpine. Markdown file paths are preferred. see https://docusaurus.io/docs/next/markdown-features/links updated docusaurus config to throw an exception when Markdown links are broken * [home] strenghten nginx configuration upgrade nginx add nginx.conf directives for security and optimization * fix docs link to full sized image hosted on Github
1 parent ff68148 commit 01d3479

10 files changed

+169
-48
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ services:
224224
- adnetwork
225225

226226
nginx:
227-
image: nginx:1.22.1-alpine
227+
image: nginx:1.27.5-alpine
228228
container_name: "proxy"
229229
volumes:
230230
# using env variables in nginx config

services/home/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM nginx:1.25-alpine3.17
15+
FROM nginx:1.27.5-alpine
1616

17-
COPY --chown=nginx:nginx nginx.conf /etc/nginx/templates/default.conf.template
17+
# Copy custom Nginx configuration
18+
COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf
19+
20+
# Copy built Docusaurus site from the buid folder
1821
COPY --chown=nginx:nginx build /usr/share/nginx/html
1922

23+
# Nginx listens on 8080, expose it (for documentation/clarity)
24+
EXPOSE 8080
25+
26+
# Start Nginx in the foreground
2027
CMD [ "nginx", "-g", "daemon off;" ]

services/home/docs/demos/bidding-and-auction.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ components of the system work together to complete an auction.
8585
- The seller's real time bidding service then forwards the encrypted ad auction result back to the publisher page. Then the
8686
`navigator.runAdAuction()`function runs on the page and displays the winning ad.
8787

88-
![Bidding Auction API Flow](https://raw.githubusercontent.com/privacysandbox/privacy-sandbox-demos/73a017521449a526da715aabeaa02734faead7b3/services/home/docs/demos/img/bidding-auction-api-flow.png)
88+
![Bidding Auction API Flow](img/bidding-auction-api-flow.png)
8989

9090
#### User Journey
9191

92-
```bash
92+
```mermaid
9393
sequenceDiagram
94+
9495
Browser->>+Advertiser: User visits a shop site and clicks on a product
9596
DSP -->>DSP: DSP implements payload optimization
9697
DSP-->>Browser: DSP calls navigator.joinAdInterestGroup(...)
@@ -110,7 +111,7 @@ sequenceDiagram
110111
Publisher Page-->>Browser: Top level seller runs navigator.runAdAuction(auctionConfig) on-device
111112
```
112113

113-
#TODO: add valid permalink ![User Journey](../demos/img/bidding-and-auction-flow.png)
114+
[Full-sized diagram](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/home/docs/demos/img/bidding-and-auction-flow.png)
114115

115116
</TabItem>
116117

@@ -632,7 +633,7 @@ sspYRouter.get('/construct-component-auction.js', async (req, res) => {
632633
```
633634
634635
7. The
635-
[construct-component-auction.ts](https://github.com/privacysandbox/privacy-sandbox-demos/blob/dev/services/ad-tech/src/public/js/ssp/usecase/bidding-and-auction/ssp-y/construct-component-auction.ts#L35)
636+
[construct-component-auction.ts](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/ssp/usecase/bidding-and-auction/ssp-y/construct-component-auction.ts#L35)
636637
file will first build the auction config.
637638
638639
```typescript
@@ -755,10 +756,10 @@ async #runComponentAdAuction(request: number[]) {
755756
The selectAd request can also be sent with a REST API call. This
756757
[proto file](https://github.com/privacysandbox/privacy-sandbox-demos/blob/e9b604243b99c4629b78a578844d054770f9d660/services/ad-tech/src/routes/ssp/usecase/bidding-and-auction/server/proto/sfe-client.proto#L3)
757758
defines the interface for interacting with the seller frontend service. The `ciphertextShaHash` uses the response from the seller front end and
758-
generates a SHA-256 hash with base64 encoding. This is to ensure payload security between the seller ad service and the browser.
759-
The ciphertext is then set as the value for the `Ad-Auction-Result` header to be passed back to the browser. The `onDeviceAuctionConfig` field is
760-
set to define the auction configuration for the on-device component of mixed mode. This will be passed to the browser along with the bidding and
761-
auction result, but it will appear as a separate component auction in the browser.
759+
generates a SHA-256 hash with base64 encoding. This is to ensure payload security between the seller ad service and the browser. The ciphertext is
760+
then set as the value for the `Ad-Auction-Result` header to be passed back to the browser. The `onDeviceAuctionConfig` field is set to define the
761+
auction configuration for the on-device component of mixed mode. This will be passed to the browser along with the bidding and auction result, but
762+
it will appear as a separate component auction in the browser.
762763
763764
```typescript
764765
mixedModeClientSFE.selectAd(

services/home/docs/demos/instream-video-ad.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ this use case.
2121

2222
### Description
2323

24-
This demo expands on the demo for the [sequential setup of Protected Audience with contextual auction](sequential-auction-setup) to showcase how video
25-
ads may be served with Protected Audience. The demo uses the industry-standard Video Ads Serving Template (VAST) XMLs to deliver video ads in iframes.
26-
Additionally, note that the technique shown in this demo does not work with [Fenced Frames](https://privacysandbox.google.com/relevance/fenced-frame),
27-
but Protected Audience allows iframe usage
24+
This demo expands on the demo for the [sequential setup of Protected Audience with contextual auction](sequential-auction-setup.md) to showcase how
25+
video ads may be served with Protected Audience. The demo uses the industry-standard Video Ads Serving Template (VAST) XMLs to deliver video ads in
26+
iframes. Additionally, note that the technique shown in this demo does not work with
27+
[Fenced Frames](https://privacysandbox.google.com/relevance/fenced-frame), but Protected Audience allows iframe usage
2828
[until at least 2026](https://privacysandbox.google.com/relevance/protected-audience-api/feature-status#fenced_frames).
2929

3030
### Privacy Sandbox APIs and related documentation
@@ -71,7 +71,7 @@ video ad bids generated are within the Protected Audience auction.
7171

7272
### System Design
7373

74-
Identical to the [sequential auction setup demo](sequential-auction-setup), the user visiting an advertiser page is added to interest groups by
74+
Identical to the [sequential auction setup demo](sequential-auction-setup.md), the user visiting an advertiser page is added to interest groups by
7575
multiple DSPs. The auction orchestration on the news publisher page is also similar at a high-level. The incremental difference is in the post-auction
7676
rendering phase where the output of the Protected Audience auction needs to be consumed by a video player.
7777

@@ -90,8 +90,8 @@ rendering phase where the output of the Protected Audience auction needs to be c
9090
post-messages it to the ad server library code on the publisher's page.
9191
- Finally, this ad server library passes the VAST XML to the video player
9292

93-
Since the overall auction orchestration for this use-case identical to that in the [sequential auction setup demo](sequential-auction-setup), we will
94-
skip ahead to the ad rendering phase.
93+
Since the overall auction orchestration for this use-case identical to that in the [sequential auction setup demo](sequential-auction-setup.md), we
94+
will skip ahead to the ad rendering phase.
9595

9696
```mermaid
9797
sequenceDiagram
@@ -148,7 +148,7 @@ Browsr ->> Browser: Ad server library passes this finalized VAST to the video pl
148148
### Implementation Details
149149

150150
The user is added to interest groups by ad buyers or DSPs using the same high-level flow as described in the
151-
[basic remarketing / retargeting use-case demo](retargeting-remarketing). These interest groups contain both display and video ads, with the DSPs
151+
[basic remarketing / retargeting use-case demo](retargeting-remarketing.md). These interest groups contain both display and video ads, with the DSPs
152152
filtering for the ad type corresponding to that signalled by ad sellers or SSPs via `auctionSignals`.
153153

154154
#### How is the video ad structured as an interest group ad?
@@ -213,7 +213,7 @@ const interestGroup = {
213213

214214
SSPs indicate the supported ad type in `auctionConfig.auctionSignals` which is made available to the DSP's `generateBid()` method at auction time.
215215
Using this information, DSPs can filter for the appropriate ad types in their
216-
[bidding logic :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/dev/services/ad-tech/src/public/js/dsp/default/auction-bidding-logic.js#L261-264);
216+
[bidding logic :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/dsp/usecase/default/auction-bidding-logic.js#L261-264);
217217

218218
#### What does the interest group ad creative do?
219219

@@ -232,11 +232,11 @@ includes a single
232232
wrapping the VAST XML.
233233

234234
This script starts by
235-
[parsing :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/67d4c6368ff422ad9e952961352b5ac74ee9f500/services/ad-tech/src/public/js/video-ad-frame.js#L38-48)
235+
[parsing :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/video-ads.js#L38)
236236
the SSP's VAST wrapping endpoint including in the URL. Then the scripts proceeds to
237-
[fetch the finalized VAST XML from this SSP endpoint :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/67d4c6368ff422ad9e952961352b5ac74ee9f500/services/ad-tech/src/public/js/video-ad-frame.js#L51-69)
237+
[fetch the finalized VAST XML from this SSP endpoint :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/video-ads.js#L51)
238238
before
239-
[post-messaging the XML content to the top frame :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/dev/services/ad-tech/src/public/js/video-ad-frame.js#L107-115).
239+
[post-messaging the XML content to the top frame :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/video-ads.js#L108).
240240

241241
```js title="Winning PA ad iframe assembles and post-messages the finalized VAST to the top frame"
242242
// ...

services/home/docs/demos/multi-piece-ad.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ through a template 'container' with customizable product slots.
3636
### Goals
3737

3838
In this demo, the auction setup and execution is similar to the
39-
[sequential setup of Protected Audience with contextual ad auction](https://privacy-sandbox-demos.dev/docs/demos/sequential-auction-setup/) demo. So,
40-
please check this use case implementation first if you want to learn about the Protected Audience auction setup.
39+
[sequential setup of Protected Audience with contextual ad auction](./sequential-auction-setup.md) demo. So, please check this use case implementation
40+
first if you want to learn about the Protected Audience auction setup.
4141

4242
The only incremental difference in this use-case is that the advertiser can provide more than one product that the user interacted with in the same ad
4343
slot.

services/home/docs/demos/publisher-ad-quality-req.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Browser ->> DSP: Request ad creative
125125
DSP -->> Browser: Return ad creative
126126
```
127127

128-
[Full-sized diagram](./img/publisher-ad-quality-req-flow.png)
128+
[Full-sized diagram](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/home/docs/demos/img/publisher-ad-quality-req-flow.png)
129129

130130
</TabItem>
131131
<TabItem value="demo" label="Demo">
@@ -166,9 +166,9 @@ shoe ad from Protected Audience will not be delivered. Instead, the ad from the
166166
### Implementation details
167167

168168
To add the user to an interest group, we reuse the implementation from the
169-
[basic retargeting / remarketing ad campaign use-case demo](retargeting-remarketing). It’s in the second half -- the auction execution and ad delivery
170-
-- where this use case differs from the regular retargeting / remarketing use-case. This is also why this use-case is on a different page on the news
171-
site.
169+
[basic retargeting / remarketing ad campaign use-case demo](retargeting-remarketing.md). It’s in the second half -- the auction execution and ad
170+
delivery -- where this use case differs from the regular retargeting / remarketing use-case. This is also why this use-case is on a different page on
171+
the news site.
172172

173173
The news page lists the available ad slot on the page in the
174174
[`window.PSDemo.PAGE_ADS_CONFIG`](https://github.com/privacysandbox/privacy-sandbox-demos/blob/67d4c6368ff422ad9e952961352b5ac74ee9f500/services/news/src/views/publisher-ad-quality-req.ejs#L29)
@@ -198,7 +198,7 @@ window.PSDemo.PAGE_ADS_CONFIG = Object.freeze({
198198
To deliver an ad for this ad slot, the news page also includes a third-party tag:
199199
[ad-server-tag.js](https://github.com/privacysandbox/privacy-sandbox-demos/blob/67d4c6368ff422ad9e952961352b5ac74ee9f500/services/news/src/views/publisher-ad-quality-req.ejs#L43)
200200
from the ad-server service. This ad server tag reads the ad slot configurations and proceeds to execute a sequential contextual + Protected Audience
201-
auction as described in the [sequential setup of Protected Audience with contextual ad auction demo](sequential-auction-setup).
201+
auction as described in the [sequential setup of Protected Audience with contextual ad auction demo](sequential-auction-setup.md).
202202

203203
```html title="Ad-server tag on publisher page: https://privacy-sandbox-demos-news.dev"
204204
<script

services/home/docs/demos/sequential-auction-setup.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Audience as an additional demand source that may or may not beat the contextual
4545

4646
In this demo, we aim to demonstrate a basic sequential auction setup with a focus on the data flow from the perspective of the Protected Audience
4747
auction and abstract a lot of the technical nuance in the contextual auction. Building on the
48-
[basic retargeting / remarketing ads demo](retargeting-remarketing), this demo shows a more realistic sequential setup with multiple buyers and
48+
[basic retargeting / remarketing ads demo](retargeting-remarketing.md), this demo shows a more realistic sequential setup with multiple buyers and
4949
sellers participating in the ad delivery process. This demo will also demonstrate SSPs sourcing `buyerSignals` from DSPs and including them in the
5050
Protected Audience auction configuration.
5151

@@ -57,8 +57,8 @@ various ad delivery setups. This demo focuses on a few exemplary _'signals'_ as
5757

5858
### System Design
5959

60-
Identical to the [basic retargeting / remarketing ads demo](retargeting-remarketing), the user visiting an advertiser page is added to interest groups
61-
by multiple DSPs. While the overall ad delvery flow on the publisher page is similar, the biggest difference in this demo is the involvement of
60+
Identical to the [basic retargeting / remarketing ads demo](retargeting-remarketing.md), the user visiting an advertiser page is added to interest
61+
groups by multiple DSPs. While the overall ad delvery flow on the publisher page is similar, the biggest difference in this demo is the involvement of
6262
multiple ad sellers. The publisher ad server starts with a simplified contextual auction with other sellers also participating to arrive at a winning
6363
contextual ad while also collating their auction configurations for the Protected Audience auction. The publisher ad server also initiates the
6464
Protected Audience auction acting as the top-level seller with all sellers including the publisher ad server conducting their individual component
@@ -173,7 +173,7 @@ end
173173
### Implementation details
174174

175175
The user is added to interest groups by DSPs using the same mechanism as described in the
176-
[basic remarketing / retargeting use-case demo](retargeting-remarketing). The incremental difference in the implementation of this demo is on the
176+
[basic remarketing / retargeting use-case demo](retargeting-remarketing.md). The incremental difference in the implementation of this demo is on the
177177
publisher page.
178178

179179
#### How does the publisher pass the ad unit configurations for a given page to the publisher ad server?
@@ -237,7 +237,7 @@ More specifically, the `ad-server-tag.js` injects an iframe for each ad unit whe
237237
Protected Audience auction to choose an ad. This iframe loads:
238238
[`https://privacy-sandbox-demos-ad-server.dev/ssp/run-sequential-ad-auction.html` :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/67d4c6368ff422ad9e952961352b5ac74ee9f500/services/ad-tech/src/views/ssp/run-sequential-ad-auction.ejs),
239239
which contains a single script:
240-
[`https://privacy-sandbox-demos-ad-server.dev/js/ssp/run-sequential-ad-auction.js` :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/dev/services/ad-tech/src/public/js/ssp/run-sequential-ad-auction.js).
240+
[`https://privacy-sandbox-demos-ad-server.dev/js/ssp/run-sequential-ad-auction.js` :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/ssp/run-sequential-ad-auction.js).
241241
This iframe expects a post-message from `ad-server-tag.js` containing the ad unit configuration as well as the list of other sellers involved in the
242242
ad delivery process.
243243

@@ -341,7 +341,7 @@ SellerContextualBidderRouter.get('/', async (req: Request, res: Response) => {
341341
342342
The publisher ad servers collates the contextual bid responses from all the sellers before assembling the combined auction configuration for Protected
343343
Audience. In the following code snippet from
344-
[`run-sequential-ad-auction.js` :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/dev/services/ad-tech/src/public/js/ssp/run-sequential-ad-auction.js#L145-182),
344+
[`run-sequential-ad-auction.js` :arrow_upper_right:](https://github.com/privacysandbox/privacy-sandbox-demos/blob/ff68148e0987979ecdac2f0183b9ca2a1b847bcc/services/ad-tech/src/public/js/ssp/run-sequential-ad-auction.js#L154),
345345
the winning contextual bid is chosen purely on the bid price. Along with the contextual bid response, the additional sellers or SSPs also respond with
346346
their Protected Audience component auction configuration. The publisher ad server also assembles the final Protected Audience auction configuration
347347
which includes these component auction configurations from other sellers as well as its own component auction.

services/home/docs/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Looking to run these demos yourself? Check our [guide](https://github.com/privac
1818
| [Incorporating publisher ad quality requirements in Protected Audience](demos/publisher-ad-quality-req.md) | Protected Audience, Fenced Frames |
1919
| [In-stream video ads with Protected Audience](demos/instream-video-ad.md) | Protected Audience |
2020
| [Ads Composed of Multiple Pieces](demos/multi-piece-ad.md) | Protected Audience |
21-
| [Bidding & Auction Services for Protected Audience](demos/bidding-and-auction) | Protected Audience, Bidding & Auction Services |
21+
| [Bidding & Auction Services for Protected Audience](demos/bidding-and-auction.md) | Protected Audience, Bidding & Auction Services |
2222
| [Event-level reports for single touch attribution](demos/single-touch-event-level-report.md) | Attribution Reporting |
2323
| [Reach Measurement](demos/reach-measurement-with-shared-storage.md) | Shared Storage, Private Aggregation |
24-
| [Multi-touch conversion Attribution](demos/multi-touch-conversion-attribution) | Private Aggregation, Shared Storage, Aggregation Service |
24+
| [Multi-touch conversion Attribution](demos/multi-touch-conversion-attribution.md) | Private Aggregation, Shared Storage, Aggregation Service |
2525
| [Single-touch conversion attribution](demos/single-touch-conversion-attribution.md) | Protected Audience, Fenced Frames, Attribution Reporting |
2626

2727
:::info

services/home/docusaurus.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ const config = {
2020
// For GitHub pages deployment, it is often '/<projectName>/'
2121
baseUrl: '/',
2222

23+
// true: add trailing slashes to URLs/links, and emit /docs/myDoc/index.html for /docs/myDoc.md
24+
trailingSlash: true,
25+
2326
// GitHub pages deployment config.
2427
// If you aren't using GitHub pages, you don't need these.
2528
organizationName: 'privacysandbox/privacy-sandbox-demos', // Usually your GitHub org/user name.
2629
projectName: 'privacy-sandbox-demos', // Usually your repo name.
2730

2831
onBrokenLinks: 'throw',
29-
onBrokenMarkdownLinks: 'warn',
32+
onBrokenMarkdownLinks: 'throw',
3033

3134
// Even if you don't use internalization, you can use this field to set useful
3235
// metadata like html lang. For example, if your site is Chinese, you may want

0 commit comments

Comments
 (0)