Skip to content

Commit

Permalink
✨ add vendor navegg analytics (#21376)
Browse files Browse the repository at this point in the history
* Added navegg analytics config

* Change param value

* Change the navegg element to respect the alphabetical order

* Add test vendor navegg

* Fix params to test vendor navegg

* Fix assert url

* Fix the pageview parameters and other annotation suggested by zhouyx

* Fix image suppresswarnings

* Remove param in test
  • Loading branch information
renankof authored and zhouyx committed Mar 28, 2019
1 parent 3477d89 commit 72949c3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extensions/amp-analytics/0.1/test/vendor-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@
"mpulse": {
"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_&rt.ss=_timestamp_&rt.end=_timestamp_&t_resp=_nav_timing_&t_page=_nav_timing_&t_done=_nav_timing_&nt_nav_type=_nav_type_&nt_red_cnt=_nav_redirect_count_&nt_nav_st=_nav_timing_&nt_red_st=_nav_timing_&nt_red_end=_nav_timing_&nt_fet_st=_nav_timing_&nt_dns_st=_nav_timing_&nt_dns_end=_nav_timing_&nt_con_st=_nav_timing_&nt_ssl_st=_nav_timing_&nt_con_end=_nav_timing_&nt_req_st=_nav_timing_&nt_res_st=_nav_timing_&nt_unload_st=_nav_timing_&nt_unload_end=_nav_timing_&nt_domloading=_nav_timing_&nt_res_end=_nav_timing_&nt_domint=_nav_timing_&nt_domcontloaded_st=_nav_timing_&nt_domcontloaded_end=_nav_timing_&nt_domcomp=_nav_timing_&nt_load_st=_nav_timing_&nt_load_end=_nav_timing_&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_&url=_canonical_url_&ref=_document_referrer_&tit=_title_&lan=_browser_language_&acc=!account&v=7"
},
"newrelic": {
"pageview": "https://bam.nr-data.net/amp?appId=!appId&licenseKey=!licenseKey&ampUrl=_ampdoc_url_&canonicalUrl=_canonical_url_&timeToDomContentLoadedEventEnd=_nav_timing_&timeToDomInteractive=_nav_timing_&timeToDomComplete=_nav_timing_&timeToDomLoading=_nav_timing_&timeToResponseStart=_nav_timing_&timeToResponseEnd=_nav_timing_&timeToLoadEventStart=_nav_timing_&timeToLoadEventEnd=_nav_timing_&timeToConnectStart=_nav_timing_&timeToConnectEnd=_nav_timing_&timeToFetchStart=_nav_timing_&timeToRequestStart=_nav_timing_&timeToUnloadEventStart=_nav_timing_&timeToUnloadEventEnd=_nav_timing_&timeToDomainLookupStart=_nav_timing_&timeToDomainLookupEnd=_nav_timing_&timeToRedirectStart=_nav_timing_&timeToRedirectEnd=_nav_timing_&timeToSecureConnection=_nav_timing_&timestamp=_timestamp_&ampVersion=_amp_version_&pageLoadTime=_page_load_time_"
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/amp-analytics/0.1/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import {MOAT_CONFIG} from './vendors/moat';
import {BG_CONFIG} from './vendors/bg';
import {UPSCORE_CONFIG} from './vendors/upscore';
import {REPPUBLIKA_CONFIG} from './vendors/reppublika';
import {NAVEGG_CONFIG} from './vendors/navegg';

/**
* @const {!JsonObject}
Expand Down Expand Up @@ -213,6 +214,7 @@ export const ANALYTICS_CONFIG = /** @type {!JsonObject} */ ({
'mobify': MOBIFY_CONFIG,
'mparticle': MPARTICLE_CONFIG,
'mpulse': MPULSE_CONFIG,
'navegg': NAVEGG_CONFIG,
'newrelic': NEWRELIC_CONFIG,
'nielsen': NIELSEN_CONFIG,
'nielsen-marketing-cloud': NIELSEN_MARKETING_CLOUD_CONFIG,
Expand Down
40 changes: 40 additions & 0 deletions extensions/amp-analytics/0.1/vendors/navegg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright 2019 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export const NAVEGG_CONFIG = /** @type {!JsonObject} */ ({
'requests': {
'pageview':
'https://amp.navdmp.com/amp?' +
'aid=${clientId(navegg_id)}&' +
'url=${canonicalUrl}&' +
'ref=${documentReferrer}&' +
'tit=${title}&' +
'lan=${browserLanguage}' +
'&acc=${account}&' +
'v=7',
},
'triggers': {
'trackpageview': {
'on': 'visible',
'request': 'pageview',
},
},
'transport': {
'beacon': false,
'xhrpost': false,
'image': {'suppressWarnings': true},
},
});

0 comments on commit 72949c3

Please sign in to comment.