Skip to content

Commit

Permalink
add client hint support for Mapp Intelligence
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanGuenther committed Aug 1, 2023
1 parent 0a5372b commit 62fed1f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
27 changes: 17 additions & 10 deletions extensions/amp-analytics/0.1/test/vendor-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,24 @@
"basePrefix": "?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,",
"baseSuffix": ",_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_",
"parameterPrefix": "?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_",
"parameterSuffix": "&pu=_source_url_&eor=1",
"pageview": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&&cp570=_page_load_time_&pu=_source_url_&eor=1",
"event": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&ct=webtrekk_ignore&&pu=_source_url_&eor=1",
"scroll": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&ct=webtrekk_ignore&ck540=!verticalScrollBoundary&pu=_source_url_&eor=1",
"parameterSuffix": "&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1",
"uachModelValue": "_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)",
"uachPlatformValue": "_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)",
"uachPlatformVersionValue": "_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)",
"uachModelParam": "_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)",
"uachPlatformParam": "_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)",
"uachPlatformVersionParam": "_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)",
"clientHintParams": "&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)",
"pageview": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&&cp570=_page_load_time_&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1",
"event": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&ct=webtrekk_ignore&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1",
"scroll": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,_timestamp_,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&ct=webtrekk_ignore&ck540=!verticalScrollBoundary&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1",
"mediaPrefix": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id",
"mediaSuffix": "&mt1=!currentTime&mt2=!duration&&pu=_source_url_&eor=1&x=!playedTotal",
"mediaPlay": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=play&mt1=!currentTime&mt2=!duration&&pu=_source_url_&eor=1&x=!playedTotal",
"mediaPause": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=pause&mt1=!currentTime&mt2=!duration&&pu=_source_url_&eor=1&x=!playedTotal",
"mediaPosition": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=pos&mt1=!currentTime&mt2=!duration&&pu=_source_url_&eor=1&x=!playedTotal",
"mediaEnded": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=eof&mt1=!currentTime&mt2=!duration&&pu=_source_url_&eor=1&x=!playedTotal",
"mediaCustomEvent": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=customMediaEvent&mt1=!currentTime&mt2=!duration&&pu=_source_url_&eor=1&x=!playedTotal"
"mediaSuffix": "&mt1=!currentTime&mt2=!duration&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1&x=!playedTotal",
"mediaPlay": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=play&mt1=!currentTime&mt2=!duration&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1&x=!playedTotal",
"mediaPause": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=pause&mt1=!currentTime&mt2=!duration&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1&x=!playedTotal",
"mediaPosition": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=pos&mt1=!currentTime&mt2=!duration&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1&x=!playedTotal",
"mediaEnded": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=eof&mt1=!currentTime&mt2=!duration&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1&x=!playedTotal",
"mediaCustomEvent": "https://!trackDomain/!trackId/wt?p=440,_title_,1,_screen_width_x_screen_height_,_screen_color_depth_,1,,_document_referrer_,_viewport_width_x_viewport_height_,0&tz=_timezone_&eid=_client_id(amp-wt3-eid)_&la=_browser_language_&mi=!id&mk=customMediaEvent&mt1=!currentTime&mt2=!duration&&pu=_source_url_&_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), X-WT-SEC-CH-UA-MODEL, !emptyValue)=_if(_if(!clientHints%252C_uach(model)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(model)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM, !emptyValue)=_if(_if(!clientHints%252C_uach(platform)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platform)__%2C%20!emptyValue)\", !emptyValue)&_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), X-WT-SEC-CH-UA-PLATFORM-VERSION, !emptyValue)=_if(_if(!clientHints%252C_uach(platformVersion)___%2C%20!emptyValue), \"_if(!clientHints%2C_uach(platformVersion)__%2C%20!emptyValue)\", !emptyValue)&eor=1&x=!playedTotal"
},
"marinsoftware": {
"base": "https://tracker.marinsm.com/tp",
Expand Down
11 changes: 11 additions & 0 deletions extensions/amp-analytics/0.1/vendors/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,16 @@
{name: 'zvalmog', notify: true},
],
},
// Vendor file for mapp intelligence
{
pattern: 'mapp_intelligence.json',
owners: [
{name: 'ampproject/wg-components'},
{name: 'Webtrekk'},
{name: 'mapp-digital'},
{name: 'StephanGuenther', notify: true},
{name: 'stiegi', notify: true},
],
},
],
}
16 changes: 14 additions & 2 deletions extensions/amp-analytics/0.1/vendors/mapp_intelligence.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@
"contentId": "${title}",
"mediaName": "${id}",
"everId": "${clientId(amp-wt3-eid)}",
"mediaEventName": "customMediaEvent"
"mediaEventName": "customMediaEvent",
"emptyValue": "",
"clientHints": false,
"uachModel": "$IF(${clientHints}, ${uach(model)}, ${emptyValue})",
"uachPlatform": "$IF(${clientHints}, ${uach(platform)}, ${emptyValue})",
"uachPlatformVersion": "$IF(${clientHints}, ${uach(platformVersion)}, ${emptyValue})"
},
"requests": {
"trackURL": "https://${trackDomain}/${trackId}/wt",
"basePrefix": "?p=440,${contentId},1,${screenWidth}x${screenHeight},${screenColorDepth},1,",
"baseSuffix": ",${documentReferrer},${viewportWidth}x${viewportHeight},0&tz=${timezone}&eid=${everId}&la=${browserLanguage}",
"parameterPrefix": "${basePrefix}${timestamp}${baseSuffix}",
"parameterSuffix": "&pu=${sourceUrl}&eor=1",
"parameterSuffix": "&pu=${sourceUrl}${clientHintParams}&eor=1",
"uachModelValue": "$IF(${uachModel}, \"${uachModel}\", ${emptyValue})",
"uachPlatformValue": "$IF(${uachPlatform}, \"${uachPlatform}\", ${emptyValue})",
"uachPlatformVersionValue": "$IF(${uachPlatformVersion}, \"${uachPlatformVersion}\", ${emptyValue})",
"uachModelParam": "$IF(${uachModel}, X-WT-SEC-CH-UA-MODEL, ${emptyValue})",
"uachPlatformParam": "$IF(${uachPlatform}, X-WT-SEC-CH-UA-PLATFORM, ${emptyValue})",
"uachPlatformVersionParam": "$IF(${uachPlatformVersion}, X-WT-SEC-CH-UA-PLATFORM-VERSION, ${emptyValue})",
"clientHintParams": "&${uachModelParam}=${uachModelValue}&${uachPlatformParam}=${uachPlatformValue}&${uachPlatformVersionParam}=${uachPlatformVersionValue}",
"pageview": "${trackURL}${parameterPrefix}&${extraUrlParams}&cp570=${pageLoadTime}${parameterSuffix}",
"event": "${trackURL}${parameterPrefix}&ct=${actionName}&${extraUrlParams}${parameterSuffix}",
"scroll": "${trackURL}${parameterPrefix}&ct=${actionName}&ck540=${verticalScrollBoundary}${parameterSuffix}",
Expand Down

0 comments on commit 62fed1f

Please sign in to comment.