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

Implement Google AdWords specific tracking pixels #7273

Merged
merged 2 commits into from Feb 1, 2017
Jump to file or symbol
Failed to load files and symbols.
+52 −33
Diff settings

Always

Just for now

@@ -220,10 +220,18 @@ describe('amp-analytics', function() {
vars: Object.create(null),
}).then(urls => {
const url = urls[0];
const val = VENDOR_REQUESTS[vendor][name];
const vendorData = VENDOR_REQUESTS[vendor];
if (!vendorData) {
throw new Error('Add vendor ' + vendor +
' to vendor-requests.json');
}
const val = vendorData[name];
if (val == '<ignore for test>') {
return;
}
if (val == null) {
throw new Error('Define ' + vendor + '.' + name +
'in vendor-requests.json. Expected value: ' + url);
' in vendor-requests.json. Expected value: ' + url);
}
actualResults[vendor][name] = url;
// Write this out for easy copy pasting.
@@ -65,8 +65,13 @@
"social": "https://www.google-analytics.com/collect?v=1&_v=a1&ds=AMP&aip=true&_s=1&dt=_title_&sr=_screen_width_x_screen_height_&_utmht=_timestamp_&cid=_client_id_&tid=$account&dl=_source_url_&dr=_document_referrer_&sd=_screen_color_depth_&ul=_browser_language_&de=_document_charset_&t=social&jid=&sa=$socialAction&sn=$socialNetwork&st=$socialTarget&a=_page_view_id_&z=_random_",
"timing": "https://www.google-analytics.com/collect?v=1&_v=a1&ds=AMP&aip=true&_s=1&dt=_title_&sr=_screen_width_x_screen_height_&_utmht=_timestamp_&cid=_client_id_&tid=$account&dl=_source_url_&dr=_document_referrer_&sd=_screen_color_depth_&ul=_browser_language_&de=_document_charset_&t=timing&jid=&plt=_page_load_time_&dns=_domain_lookup_time_&tcp=_tcp_connect_time_&rrt=_redirect_time_&srt=_server_response_time_&pdt=_page_download_time_&clt=_content_load_time_&dit=_dom_interactive_time_&a=_page_view_id_&z=_random_"
},
"googleconversion": {
"conversion": "https://www.googleadservices.com/pagead/conversion/$google_conversion_id/?cv=amp1&value=$google_conversion_value&currency_code=$google_conversion_currency&label=$google_conversion_label&random=_random_&url=_source_url_&fst=_page_view_id_&num=_counter_&fmt=3&async=3&bg=$google_conversion_color&u_h=_screen_height_&u_w=_screen_width_&u_ah=_viewport_height_&u_aw=_viewport_width_&u_cd=_screen_color_depth_&u_tz=_timezone_&tiba=_title_&guid=ON&script=0"
"googleadwords": {
"conversion_prefix": "<ignore for test>",
"remarketing_prefix": "<ignore for test>",
"common_params": "<ignore for test>",
"conversion_params": "<ignore for test>",
"conversion": "https://www.googleadservices.com/pagead/conversion/$googleConversionId/?cv=amp2&label=$googleConversionLabel&random=_random_&url=_source_url_&ref=_document_referrer_&fst=_page_view_id_&num=_counter_&fmt=3&async=1&u_h=_screen_height_&u_w=_screen_width_&u_ah=_available_screen_height_&u_aw=_available_screen_width_&u_cd=_screen_color_depth_&u_tz=_timezone_&tiba=_title_&guid=ON&script=0&value=$googleConversionValue&currency_code=$googleConversionCurrency&bg=$googleConversionColor&hl=$googleConversionLanguage",
"remarketing": "https://googleads.g.doubleclick.net/pagead/viewthroughconversion/$googleConversionId/?cv=amp2&label=$googleConversionLabel&random=_random_&url=_source_url_&ref=_document_referrer_&fst=_page_view_id_&num=_counter_&fmt=3&async=1&u_h=_screen_height_&u_w=_screen_width_&u_ah=_available_screen_height_&u_aw=_available_screen_width_&u_cd=_screen_color_depth_&u_tz=_timezone_&tiba=_title_&guid=ON&script=0"
},
"lotame": {
"pageview": "https://bcp.crwdcntrl.net/amp?c=$account&pv=y"
@@ -413,6 +413,41 @@ export const ANALYTICS_CONFIG = /** @type {!JSONType} */ ({
},
},
'googleadwords': {
'requests': {
'conversion_prefix': 'https://www.googleadservices.com/pagead/conversion/',
'remarketing_prefix':

This comment has been minimized.

@avimehta

avimehta Feb 1, 2017

Collaborator

was this the main change in this PR?

This comment has been minimized.

@cramforce

cramforce Feb 1, 2017

Member

Yeah. I just copy pasted this from the actual product manager of this feature.

'https://googleads.g.doubleclick.net/pagead/viewthroughconversion/',
'common_params': '${googleConversionId}/?' +
'cv=amp2&' + // Increment when making changes.
'label=${googleConversionLabel}&' +
'random=${random}&' +
'url=${sourceUrl}&' +
'ref=${documentReferrer}&' +
'fst=${pageViewId}&' +
'num=${counter(googleadwords)}&' +
'fmt=3&' +
'async=1&' +
'u_h=${screenHeight}&u_w=${screenWidth}&' +
'u_ah=${availableScreenHeight}&u_aw=${availableScreenWidth}&' +
'u_cd=${screenColorDepth}&' +
'u_tz=${timezone}&' +
'tiba=${title}&' +
'guid=ON&script=0',
'conversion_params': 'value=${googleConversionValue}&' +
'currency_code=${googleConversionCurrency}&' +
'bg=${googleConversionColor}&' +
'hl=${googleConversionLanguage}',
'conversion': '${conversion_prefix}${common_params}&${conversion_params}',
'remarketing': '${remarketing_prefix}${common_params}',
},
'transport': {
'beacon': false,
'xhrpost': false,
'image': true,
},
},
'googleanalytics': {
'vars': {
'eventValue': '0',
@@ -489,35 +524,6 @@ export const ANALYTICS_CONFIG = /** @type {!JSONType} */ ({
'optout': '_gaUserPrefs.ioo',
},
'googleconversion': {
'requests': {
'conversion': 'https://www.googleadservices.com/pagead/conversion/' +
'${google_conversion_id}/?' +
'cv=amp1&' + // Increment when making changes.
'value=${google_conversion_value}&' +
'currency_code=${google_conversion_currency}&' +
'label=${google_conversion_label}&' +
'random=${random}&' +
'url=${sourceUrl}&' +
'fst=${pageViewId}&' +
'num=${counter(googleconversion)}&' +
'fmt=3&' +
'async=3&' +
'bg=${google_conversion_color}&' +
'u_h=${screenHeight}&u_w=${screenWidth}&' +
'u_ah=${viewportHeight}&u_aw=${viewportWidth}&' +
'u_cd=${screenColorDepth}&' +
'u_tz=${timezone}&' +
'tiba=${title}&' +
'guid=ON&script=0',
},
'transport': {
'beacon': false,
'xhrpost': false,
'image': true,
},
},
'krux': {
'requests': {
'beaconHost': 'https://beacon.krxd.net',
ProTip! Use n and p to navigate between commits in a pull request.