Skip to content

Conversation

@JSzychulec
Copy link

No description provided.

@kpiegza kpiegza requested a review from Copilot June 3, 2025 06:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for handling Gemius codes by integrating a new script URL into the native ad response. The changes include:

  • Adding constants for the Gemius script URL, parameter prefix, and required parameters.
  • Extending the native response with a new JavaScript tracker that injects the Gemius script.
  • Adding a helper function (getGdeScriptUrl) that constructs the Gemius script URL based on ad data fields.

if (REQUIRED_GDE_PARAMS.every(param => adDataFields[param])) {
const params = new URLSearchParams();
Object.entries(adDataFields)
.filter(([key]) => key.startsWith(GDE_PARAM_PREFIX))
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider ensuring that only the required parameters (those in REQUIRED_GDE_PARAMS) are included in the URL query string to avoid unintentionally appending extra fields from adDataFields.

Suggested change
.filter(([key]) => key.startsWith(GDE_PARAM_PREFIX))
.filter(([key]) => REQUIRED_GDE_PARAMS.includes(key) && key.startsWith(GDE_PARAM_PREFIX))

Copilot uses AI. Check for mistakes.
return nativeResponse
}

const getGdeScriptUrl = (adDataFields) => {
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Add inline comments to clarify the expected structure of adDataFields and the purpose of each key in REQUIRED_GDE_PARAMS to assist future maintainers.

Copilot uses AI. Check for mistakes.
Copy link

@kpiegza kpiegza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spoko, wszystko gra. Myślałem nad jakimś cache busterem, ale ten skrypt i tak raczej będzie rzadko wdrażany, a że pola z kreacji lecą w query paramsach, to w sumie trochę będzie działać jak cache buster, więc chyba nie ma sensu kombinować.

@JSzychulec JSzychulec merged commit 11f8a45 into dreamlab-master Jun 4, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants