Skip to content

Commit

Permalink
✨ Add new analytics variables for Navegg vendor (ampproject#40194)
Browse files Browse the repository at this point in the history
* feat(new variables): 🛠  Adds new analytics variables for Navegg vendor

* feat(new variables): 🛠  Adjust optional variables validation

* feat(new variables): 🛠  Fix navegg URL version parameter

* feat(AMP new variables): 🛠  Ensure new variables value

* feat(AMP new variables): 🛠  Test fix, params adjust
  • Loading branch information
hugocs1 authored Oct 29, 2024
1 parent 34a72d8 commit ac32751
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion ads/vendors/navegg.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {doubleclick} from '#ads/google/doubleclick';
* @param {!Object} data
*/
export function navegg(global, data) {
validateData(data, ['acc']);
const requiredParams = ['acc', 'wst', 'wct', 'wla'];
const optionalParams = [];

validateData(data, requiredParams, optionalParams);

const {acc} = data;
let seg,
nvg = function () {};
Expand All @@ -17,6 +21,9 @@ export function navegg(global, data) {
loadScript(global, 'https://tag.navdmp.com/amp.1.0.0.min.js', () => {
nvg = global[`nvg${acc}`] = new global['AMPNavegg']({
acc,
wst: data.wst ? '1' : '0',
wct: data.wct ? '1' : '0',
wla: data.wla ? '1' : '0',
});
nvg.getProfile((nvgTargeting) => {
for (seg in nvgTargeting) {
Expand Down
2 changes: 1 addition & 1 deletion ads/vendors/navegg.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ To get Navegg integration working you only need to specify the `rtc-config` para

The Navegg adapter only supports DoubleClick for now. For the most up-to-date list of DoubleClick supported parameters and usage, refer to the [DoubleClick reference guide](https://github.com/ampproject/amphtml/blob/main/ads/google/doubleclick.md).

For any help, please contact [Navegg](https://www.navegg.com/en/institutional/#contact).
For any help, please contact [Navegg](https://www.navegg.com/en/about-us/contacts).
2 changes: 1 addition & 1 deletion extensions/amp-analytics/0.1/test/vendor-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"onvisible": "https://!beacon_url?h.d=!h.d&h.key=!h.key&h.t=!h.t&h.cr=!h.cr&rt.start=navigation&rt.si=_client_id(amp_mpulse)_&rt.ss=_timestamp_&rt.end=_timestamp_&t_resp=_nav_timing(navigationStart%2CresponseStart)_&t_page=_nav_timing(responseStart%2CloadEventStart)_&t_done=_nav_timing(navigationStart%2CloadEventStart)_&nt_nav_type=_nav_type_&nt_red_cnt=_nav_redirect_count_&nt_nav_st=_nav_timing(navigationStart)_&nt_red_st=_nav_timing(redirectStart)_&nt_red_end=_nav_timing(redirectEnd)_&nt_fet_st=_nav_timing(fetchStart)_&nt_dns_st=_nav_timing(domainLookupStart)_&nt_dns_end=_nav_timing(domainLookupEnd)_&nt_con_st=_nav_timing(connectStart)_&nt_ssl_st=_nav_timing(secureConnectionStart)_&nt_con_end=_nav_timing(connectEnd)_&nt_req_st=_nav_timing(requestStart)_&nt_res_st=_nav_timing(responseStart)_&nt_unload_st=_nav_timing(unloadEventStart)_&nt_unload_end=_nav_timing(unloadEventEnd)_&nt_domloading=_nav_timing(domLoading)_&nt_res_end=_nav_timing(responseEnd)_&nt_domint=_nav_timing(domInteractive)_&nt_domcontloaded_st=_nav_timing(domContentLoadedEventStart)_&nt_domcontloaded_end=_nav_timing(domContentLoadedEventEnd)_&nt_domcomp=_nav_timing(domComplete)_&nt_load_st=_nav_timing(loadEventStart)_&nt_load_end=_nav_timing(loadEventEnd)_&v=1&http.initiator=amp&u=_source_url_&amp.u=_ampdoc_url_&r2=_document_referrer_&scr.xy=_screen_width_x_screen_height_"
},
"navegg": {
"pageview": "https://amp.navdmp.com/amp?aid=_client_id(navegg_id)_&url=_canonical_url_&ref=_document_referrer_&tit=_title_&lan=_browser_language_&acc=!account&v=7"
"pageview": "https://amp.navdmp.com/amp?aid=_client_id(navegg_id)_&url=_canonical_url_&ref=_document_referrer_&tit=_title_&lan=_browser_language_&acc=!account&wst=!wst&wct=!wct&wla=!wla&v=7"
},
"neodata": {
"base": "https://tra.neodatagroup.com",
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-analytics/0.1/vendors/navegg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"requests": {
"pageview": "https://amp.navdmp.com/amp?aid=${clientId(navegg_id)}&url=${canonicalUrl}&ref=${documentReferrer}&tit=${title}&lan=${browserLanguage}&acc=${account}&v=7"
"pageview": "https://amp.navdmp.com/amp?aid=${clientId(navegg_id)}&url=${canonicalUrl}&ref=${documentReferrer}&tit=${title}&lan=${browserLanguage}&acc=${account}&wst=${wst}&wct=${wct}&wla=${wla}&v=7"
},
"triggers": {
"trackpageview": {
Expand Down
4 changes: 2 additions & 2 deletions src/service/real-time-config/callout-vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ const RTC_VENDORS = jsonConfiguration({
disableKeyAppend: true,
},
navegg: {
url: 'https://usr.navdmp.com/usr?acc=NVG_ACC&wst=0&v=10',
macros: ['NVG_ACC'],
url: 'https://usr.navdmp.com/usr?acc=NVG_ACC&wst=WST&wct=WCT&wla=WLA&v=10',
macros: ['NVG_ACC', 'WST', 'WCT', 'WLA'],
disableKeyAppend: true,
},
newspassid: {
Expand Down

0 comments on commit ac32751

Please sign in to comment.