Rename event to action in Snowplow helpers and FE event handlers [RUN ALL RSPEC]
What does this MR do?
Related to #290962 (closed)
-
Add support for data-track-action
to declare events in tracking.js, and deprecatedata-track-event
. -
Check hardcoded data-track-event instances (e.g. helpers, dangerbot). -
Update related docs.
Next steps
- Replace
event
withaction
in all patterns (!56904 (merged)). - Stop supporting
data-track-event
(mentioned in #290962 (closed))
Screenshots & Logs
Event received on Snowplow Debugger from app/views/layouts/header/_default.html.haml#L59
Event received on Snowplow Micro from app/views/layouts/header/_default.html.haml#L59
{
"rawEvent":{
"api":{
"vendor":"com.snowplowanalytics.snowplow",
"version":"tp2"
},
"parameters":{
"e":"se",
"f_qt":"0",
"duid":"11e3fd5b-4975-4d3f-9a8d-cfcb668df6bb",
"vid":"1",
"f_ag":"0",
"eid":"99b0dd41-1b6b-473d-98ab-b25c6796c0c9",
"se_pr":"navigation",
"url":"http://127.0.0.1:3000/",
"refr":"http://127.0.0.1:3000/",
"aid":"gitlab",
"f_dir":"0",
"tna":"gl",
"cs":"UTF-8",
"cd":"30",
"stm":"1616093832797",
"tz":"America/Santiago",
"f_pdf":"1",
"f_java":"0",
"tv":"js-2.16.2",
"se_ac":"click_merge_link",
"se_la":"main_navigation",
"vp":"1792x1016",
"ds":"1792x1074",
"f_realp":"0",
"se_ca":"root:index",
"res":"1792x1120",
"f_fla":"0",
"cookie":"1",
"p":"web",
"dtm":"1613597498500",
"f_gears":"0",
"lang":"en-US",
"sid":"0b269a53-4b94-4f2d-aa66-fe1f38428ca1",
"f_wma":"0"
},
"contentType":"application/json",
"source":{
"name":"ssc-2.1.0-stdout$",
"encoding":"UTF-8",
"hostname":"localhost"
},
"context":{
"timestamp":"2021-03-18T18:57:13.072Z",
"useragent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
"refererUri":"http://127.0.0.1:3000/",
"headers":[
"Timeout-Access: <function1>",
"Host: localhost:9090",
"Connection: keep-alive",
"sec-ch-ua: \"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\"",
"sec-ch-ua-mobile: ?0",
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
"Accept: */*",
"Origin: http://127.0.0.1:3000",
"Sec-Fetch-Site: cross-site",
"Sec-Fetch-Mode: cors",
"Sec-Fetch-Dest: empty",
"Referer: http://127.0.0.1:3000/",
"Accept-Encoding: gzip, deflate, br",
"Accept-Language: en-US, en;q=0.9",
"application/json"
]
}
},
"eventType":"struct",
"schema":"iglu:com.google.analytics/event/jsonschema/1-0-0",
"contexts":[
"iglu:com.gitlab/gitlab_standard/jsonschema/1-0-3",
"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
"iglu:org.w3/PerformanceTiming/jsonschema/1-0-0"
],
"event":{
"app_id":"gitlab",
"platform":"web",
"etl_tstamp":"2021-03-18T18:57:15.818Z",
"collector_tstamp":"2021-03-18T18:57:13.072Z",
"dvce_created_tstamp":"2021-02-17T21:31:38.500Z",
"event":"struct",
"event_id":"99b0dd41-1b6b-473d-98ab-b25c6796c0c9",
"txn_id":null,
"name_tracker":"gl",
"v_tracker":"js-2.16.2",
"v_collector":"ssc-2.1.0-stdout$",
"v_etl":"snowplow-micro-1.1.0-common-1.4.2",
"user_id":null,
"user_ipaddress":"172.17.0.1",
"user_fingerprint":null,
"domain_userid":"11e3fd5b-4975-4d3f-9a8d-cfcb668df6bb",
"domain_sessionidx":1,
"network_userid":"ab3a8e67-797f-49bf-81bb-076b24d5ac4f",
"geo_country":null,
"geo_region":null,
"geo_city":null,
"geo_zipcode":null,
"geo_latitude":null,
"geo_longitude":null,
"geo_region_name":null,
"ip_isp":null,
"ip_organization":null,
"ip_domain":null,
"ip_netspeed":null,
"page_url":"http://127.0.0.1:3000/",
"page_title":null,
"page_referrer":"http://127.0.0.1:3000/",
"page_urlscheme":"http",
"page_urlhost":"127.0.0.1",
"page_urlport":3000,
"page_urlpath":"/",
"page_urlquery":null,
"page_urlfragment":null,
"refr_urlscheme":"http",
"refr_urlhost":"127.0.0.1",
"refr_urlport":3000,
"refr_urlpath":"/",
"refr_urlquery":null,
"refr_urlfragment":null,
"refr_medium":null,
"refr_source":null,
"refr_term":null,
"mkt_medium":null,
"mkt_source":null,
"mkt_term":null,
"mkt_content":null,
"mkt_campaign":null,
"contexts":{
"schema":"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
"data":[
{
"schema":"iglu:com.gitlab/gitlab_standard/jsonschema/1-0-3",
"data":{
"environment":"development",
"source":"gitlab-javascript"
}
},
{
"schema":"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
"data":{
"id":"9a24dafa-ceb9-4d3c-a947-d4f7f8fcecb9"
}
},
{
"schema":"iglu:org.w3/PerformanceTiming/jsonschema/1-0-0",
"data":{
"navigationStart":1613597484090,
"unloadEventStart":1613597494814,
"unloadEventEnd":1613597494814,
"redirectStart":0,
"redirectEnd":0,
"fetchStart":1613597484097,
"domainLookupStart":1613597484097,
"domainLookupEnd":1613597484097,
"connectStart":1613597484097,
"connectEnd":1613597484097,
"secureConnectionStart":0,
"requestStart":1613597484106,
"responseStart":1613597494808,
"responseEnd":1613597494809,
"domLoading":1613597494817,
"domInteractive":1613597494906,
"domContentLoadedEventStart":1613597495416,
"domContentLoadedEventEnd":1613597495422,
"domComplete":1613597495662,
"loadEventStart":1613597495662,
"loadEventEnd":1613597495663
}
}
]
},
"se_category":"root:index",
"se_action":"click_merge_link",
"se_label":"main_navigation",
"se_property":"navigation",
"se_value":null,
"unstruct_event":null,
"tr_orderid":null,
"tr_affiliation":null,
"tr_total":null,
"tr_tax":null,
"tr_shipping":null,
"tr_city":null,
"tr_state":null,
"tr_country":null,
"ti_orderid":null,
"ti_sku":null,
"ti_name":null,
"ti_category":null,
"ti_price":null,
"ti_quantity":null,
"pp_xoffset_min":null,
"pp_xoffset_max":null,
"pp_yoffset_min":null,
"pp_yoffset_max":null,
"useragent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
"br_name":null,
"br_family":null,
"br_version":null,
"br_type":null,
"br_renderengine":null,
"br_lang":"en-US",
"br_features_pdf":true,
"br_features_flash":false,
"br_features_java":false,
"br_features_director":false,
"br_features_quicktime":false,
"br_features_realplayer":false,
"br_features_windowsmedia":false,
"br_features_gears":false,
"br_features_silverlight":false,
"br_cookies":true,
"br_colordepth":"30",
"br_viewwidth":1792,
"br_viewheight":1016,
"os_name":null,
"os_family":null,
"os_manufacturer":null,
"os_timezone":"America/Santiago",
"dvce_type":null,
"dvce_ismobile":null,
"dvce_screenwidth":1792,
"dvce_screenheight":1120,
"doc_charset":"UTF-8",
"doc_width":1792,
"doc_height":1074,
"tr_currency":null,
"tr_total_base":null,
"tr_tax_base":null,
"tr_shipping_base":null,
"ti_currency":null,
"ti_price_base":null,
"base_currency":null,
"geo_timezone":null,
"mkt_clickid":null,
"mkt_network":null,
"etl_tags":null,
"dvce_sent_tstamp":"2021-03-18T18:57:12.797Z",
"refr_domain_userid":null,
"refr_dvce_tstamp":null,
"derived_contexts":{
},
"domain_sessionid":"0b269a53-4b94-4f2d-aa66-fe1f38428ca1",
"derived_tstamp":"2021-02-17T21:31:38.775Z",
"event_vendor":"com.google.analytics",
"event_name":"event",
"event_format":"jsonschema",
"event_version":"1-0-0",
"event_fingerprint":null,
"true_tstamp":null
}
}
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Axel García