{"_id":"57d74abb6f47170e008fa80f","version":{"_id":"5668fab608f90021008e8832","__v":19,"project":"5668fab608f90021008e882f","createdAt":"2015-12-10T04:08:22.769Z","releaseDate":"2015-12-10T04:08:22.769Z","categories":["5668fab708f90021008e8833","569740f124490c3700170a64","569742b58560a60d00e2c25d","569742bd0b09a41900b2446c","569742cd69393517000c82b3","569742f459a6692d003fad8f","569743020b09a41900b2446d","5697430b69393517000c82b5","56a17776470ae00d00c30642","56a2c48a831e2a0d0069b1ad","56b535757bccae0d00e9a1cd","56e1ff6aa49fdc0e005746b5","57e1c88115bf6522002a5e4e","57fa65275ba65a17008b988f","57fbeea34002550e004c032e","58474584889b6c2d00fb86e9","58475dcc64157f0f002f1907","587e7b5158666c2700965d4e","58a349fc30852819007ba083"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.18.0","version":"1.18"},"project":"5668fab608f90021008e882f","user":"5668fa9755e4b32100935d41","parentDoc":null,"category":{"_id":"56a2c48a831e2a0d0069b1ad","version":"5668fab608f90021008e8832","__v":5,"project":"5668fab608f90021008e882f","pages":["56a2c4990aefae0d00b7fee4","56a2c4a342dfda0d000463a3","56a2c4bf06150b0d002ad262","56a2c4dd2029df19002b595c","56ec9485406ab51700200633"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-23T00:08:42.770Z","from_sync":false,"order":9,"slug":"debugging","title":"Web Debugging"},"__v":1,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-13T00:39:23.502Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"By default, we send the following events to query.petametrics.com/__activity.gif associated with each widget rendering. Note that, with the exception of `widget_response`, these events are sent *only if you have set up tracking correctly*.\n<ul>\n<li>`widget_response`: This event is sent when we receive recommendations from LiftIgniter's query server, confirming the list of recommendations we have received and that we plan to render. Note that this will get sent only in LiftIgniter's slice where you are requesting recommendations, and will not get sent in the base slice. It is also independent of your tracking implementation, so it works even if you have not enabled tracking.</li>\n<li>`widget_shown`: This event is sent when the widget has rendered and the track functionality is called on it.</li>\n<li>`widget_visible`: This event is sent when the widget enters the user's viewport. If the widget is in the viewport at the time it finishes rendering, the event is triggered immediately. Otherwise, it is triggered when the user scrolls to the item.</li>\n<li>`widget_click`: This event is triggered when the user clicks (either a left-click or a right-click) on one of the recommended items.</li>\n</ul>\n\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Assumed familiarity with console debugging and event-sending\",\n  \"body\": \"This page builds on information in the [Console Debugging](doc:console-debugging) and [Pageview and Heartbeat Events](doc:pageview-and-heartbeat-events) sections. You may need to read through those sections if some of the information presented here is unclear to you.\\n\\nThe page also makes more sense after you have read the documentation on [Rendering Widgets](doc:rendering-widgets) and [Tracking Widgets](doc:tracking-widgets).\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Understand what's getting sent\"\n}\n[/block]\nSee Section 1 of the [Pageview and Heartbeat Events](doc:pageview-and-heartbeat-events) page for details on the fields that get sent by default with most activities.\n\nAdditionally, widget events have the following additional fields:\n\n* `vi` (stands for `visibleItems`): This is the list of all the visible items in the recommendation section. This includes all items that match the selector inside the widget area. All widget events associated with a given rendered widget should have the same value of `vi`. Note that the set of visible items should ideally match with the inventory items being recommended, but it is possible to have additional visible items (such as links to author or section pages that render within the widget). If you have a situation where the anchor link differs from the inventory item being recommended, please get in touch with [Support](doc:support). If you do not have anchors, see the [Tracking with no Anchor](doc:tracking-with-no-anchor) section.\n* `w` (stands for `widgetName`): This is the name of the widget being rendered. It should match the same you use in your `register` and `track` calls.\n* `source`: This describes the A/B test slice. If LiftIgniter's recommendations are used, this should be set to \"LI\", otherwise it should be set to \"base\". This value should match the value you set in your `track` call.\n\nThe `widget_click` event has the following additional fields: \n\n* `clickUrl` for the URL that was clicked\n*  `trigger` describes the trigger for the click. It can take two values: `click` (for a left click) and `contextmenu` (for a right click).\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Check that the events are being sent correctly\"\n}\n[/block]\nYou can filter in the Network panel for petametrics, load your page, and have it render and track the recommendations. You should check that:\n\n* The `widget_shown`,`widget_visible`, and `widget_click` events are sent as expected based on their descriptions. For the `widget_click` event, when testing the left click, you may need to use the Preserve Log function in the Chrome Network Panel in order to capture events across pageviews.\n*  The `vi`, `w`, and `source` field values are correctly set for these events.\n* The `clickUrl` and `trigger` values are set correctly for the `widget_click` event.\n* There are no console log messages with warnings from LiftIgniter.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Report response errors\"\n}\n[/block]\nIf you encouter any trouble or puzzling behavior when debugging, contact [Support](doc:support). In your email, include as much detail as possible about the error.","excerpt":"","slug":"widget-events","type":"basic","title":"Widget Events"}
By default, we send the following events to query.petametrics.com/__activity.gif associated with each widget rendering. Note that, with the exception of `widget_response`, these events are sent *only if you have set up tracking correctly*. <ul> <li>`widget_response`: This event is sent when we receive recommendations from LiftIgniter's query server, confirming the list of recommendations we have received and that we plan to render. Note that this will get sent only in LiftIgniter's slice where you are requesting recommendations, and will not get sent in the base slice. It is also independent of your tracking implementation, so it works even if you have not enabled tracking.</li> <li>`widget_shown`: This event is sent when the widget has rendered and the track functionality is called on it.</li> <li>`widget_visible`: This event is sent when the widget enters the user's viewport. If the widget is in the viewport at the time it finishes rendering, the event is triggered immediately. Otherwise, it is triggered when the user scrolls to the item.</li> <li>`widget_click`: This event is triggered when the user clicks (either a left-click or a right-click) on one of the recommended items.</li> </ul> [block:callout] { "type": "info", "title": "Assumed familiarity with console debugging and event-sending", "body": "This page builds on information in the [Console Debugging](doc:console-debugging) and [Pageview and Heartbeat Events](doc:pageview-and-heartbeat-events) sections. You may need to read through those sections if some of the information presented here is unclear to you.\n\nThe page also makes more sense after you have read the documentation on [Rendering Widgets](doc:rendering-widgets) and [Tracking Widgets](doc:tracking-widgets)." } [/block] [block:api-header] { "type": "basic", "title": "1. Understand what's getting sent" } [/block] See Section 1 of the [Pageview and Heartbeat Events](doc:pageview-and-heartbeat-events) page for details on the fields that get sent by default with most activities. Additionally, widget events have the following additional fields: * `vi` (stands for `visibleItems`): This is the list of all the visible items in the recommendation section. This includes all items that match the selector inside the widget area. All widget events associated with a given rendered widget should have the same value of `vi`. Note that the set of visible items should ideally match with the inventory items being recommended, but it is possible to have additional visible items (such as links to author or section pages that render within the widget). If you have a situation where the anchor link differs from the inventory item being recommended, please get in touch with [Support](doc:support). If you do not have anchors, see the [Tracking with no Anchor](doc:tracking-with-no-anchor) section. * `w` (stands for `widgetName`): This is the name of the widget being rendered. It should match the same you use in your `register` and `track` calls. * `source`: This describes the A/B test slice. If LiftIgniter's recommendations are used, this should be set to "LI", otherwise it should be set to "base". This value should match the value you set in your `track` call. The `widget_click` event has the following additional fields: * `clickUrl` for the URL that was clicked * `trigger` describes the trigger for the click. It can take two values: `click` (for a left click) and `contextmenu` (for a right click). [block:api-header] { "type": "basic", "title": "2. Check that the events are being sent correctly" } [/block] You can filter in the Network panel for petametrics, load your page, and have it render and track the recommendations. You should check that: * The `widget_shown`,`widget_visible`, and `widget_click` events are sent as expected based on their descriptions. For the `widget_click` event, when testing the left click, you may need to use the Preserve Log function in the Chrome Network Panel in order to capture events across pageviews. * The `vi`, `w`, and `source` field values are correctly set for these events. * The `clickUrl` and `trigger` values are set correctly for the `widget_click` event. * There are no console log messages with warnings from LiftIgniter. [block:api-header] { "type": "basic", "title": "3. Report response errors" } [/block] If you encouter any trouble or puzzling behavior when debugging, contact [Support](doc:support). In your email, include as much detail as possible about the error.