Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make it possible to use either adID or adId in tracking url #80

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading