Skip to content
6 changes: 3 additions & 3 deletions extensions/amp-analytics/0.1/test/vendor-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@
},
"parsely": {
"host": "https://srv.pixel.parsely.com",
"basePrefix": "https://srv.pixel.parsely.com/plogger/?rand=_timestamp_&idsite=!apikey&url=_ampdoc_url_&urlref=_document_referrer_&screen=_screen_width_x_screen_height_%7C_available_screen_width_x_available_screen_height_%7C_screen_color_depth_&title=_title_&date=_timestamp_&ampid=_client_id_",
"pageview": "https://srv.pixel.parsely.com/plogger/?rand=_timestamp_&idsite=!apikey&url=_ampdoc_url_&urlref=_document_referrer_&screen=_screen_width_x_screen_height_%7C_available_screen_width_x_available_screen_height_%7C_screen_color_depth_&title=_title_&date=_timestamp_&ampid=_client_id_&action=pageview&metadata={\"canonical_url\":\"_canonical_url_\"}",
"heartbeat": "https://srv.pixel.parsely.com/plogger/?rand=_timestamp_&idsite=!apikey&url=_ampdoc_url_&urlref=_document_referrer_&screen=_screen_width_x_screen_height_%7C_available_screen_width_x_available_screen_height_%7C_screen_color_depth_&title=_title_&date=_timestamp_&ampid=_client_id_&action=heartbeat&tt=_total_engaged_time_&inc=_incremental_engaged_time_"
"basePrefix": "https://srv.pixel.parsely.com/plogger/?rand=_timestamp_&idsite=!apikey&url=_ampdoc_url_&urlref=_document_referrer_&screen=_screen_width_x_screen_height_%7C_available_screen_width_x_available_screen_height_%7C_screen_color_depth_&data=%7B%7D&title=_title_&date=_timestamp_&ampid=_client_id_",
"pageview": "https://srv.pixel.parsely.com/plogger/?rand=_timestamp_&idsite=!apikey&url=_ampdoc_url_&urlref=_document_referrer_&screen=_screen_width_x_screen_height_%7C_available_screen_width_x_available_screen_height_%7C_screen_color_depth_&data=%7B%7D&title=_title_&date=_timestamp_&ampid=_client_id_&action=pageview&metadata={\"canonical_url\":\"_canonical_url_\"}",
"heartbeat": "https://srv.pixel.parsely.com/plogger/?rand=_timestamp_&idsite=!apikey&url=_ampdoc_url_&urlref=_document_referrer_&screen=_screen_width_x_screen_height_%7C_available_screen_width_x_available_screen_height_%7C_screen_color_depth_&data=%7B%7D&title=_title_&date=_timestamp_&ampid=_client_id_&action=heartbeat&tt=_total_engaged_time_&inc=_incremental_engaged_time_"
},
"permutive": {
"track": "https://!namespace.amp.permutive.com/track?k=!key&i=_client_id_&it=amp&_ep_client.type=amp&_ep_client.title=_title_&_ep_client.domain=_canonical_host_&_ep_client.url=_canonical_url_&_ep_client.referrer=_document_referrer_&_ep_client.user_agent=_user_agent_",
Expand Down
4 changes: 4 additions & 0 deletions extensions/amp-analytics/0.1/vendors/parsely.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import {jsonLiteral} from '../../../../src/json';

const PARSELY_CONFIG = jsonLiteral({
'vars': {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you still need to add data here? This is just the generic template for parsely integration so it will be sent for every customer who doesn't have a custom implementation. Customers can choose to override these variables, requests, pageview, and heartbeat in their amp configuration in their implementation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm not sure it's strictly necessary, but the intent here was to make the default AMP requests mimic the behavior of the standard tracker. With the standard Parse.ly tracker, the data property is always sent on all events, and it's default value is an empty object ({}) in cases where integrators don't pass any custom data. Without this variable definition, the AMP tracker equivalent would send an empty string instead. I figured consistency would make it easier to reason about in downstream systems, but if you think that adds too much overhead to the default template, we can remove.

'data': '{}',
},
'requests': {
'host': 'https://srv.pixel.parsely.com',
'basePrefix':
Expand All @@ -28,6 +31,7 @@ const PARSELY_CONFIG = jsonLiteral({
'screen=${screenWidth}x${screenHeight}%7C' +
'${availableScreenWidth}x${availableScreenHeight}%7C' +
'${screenColorDepth}&' +
'data=${data}&' +
'title=${title}&' +
'date=${timestamp}&' +
'ampid=${clientId(_parsely_visitor)}',
Expand Down