Skip to content

Commit

Permalink
fix: make it possible to use either adID or adId in tracking url
Browse files Browse the repository at this point in the history
  • Loading branch information
oscnord committed Feb 1, 2024
1 parent f14dd5b commit 2a477d1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions api/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ const schemas = {
properties: {
adId: {
type: "string",
description: "The ID for the Ad. ",
description: "The ID for the Ad (if VAST v4.0)",
example: "adid-123",
},
adID: {
type: "string",
description: "The ID for the Ad (if VAST v2.0 or v3.0)",
example: "adid-123",
},
progress: {
Expand All @@ -400,7 +405,14 @@ const schemas = {
example: "75",
},
},
required: ["adId", "progress"],
oneOf: [
{
required: ["adId", "progress"],
},
{
required: ["adID", "progress"],
},
],
},
response: {
200: {
Expand Down Expand Up @@ -826,7 +838,7 @@ module.exports = (fastify, opt, next) => {
try {
// Get path parameters and query parameters.
const sessionId = req.params.sessionId;
const adId = req.query.adId;
const adId = req.query.adId || req.query.adID;
const viewProgress = req.query.progress || null;
const userAgent = req.headers["user-agent"] || "Not Found";
const eventNames = {
Expand Down

0 comments on commit 2a477d1

Please sign in to comment.