1/** 2 * Run the "Search" event for Google Analytics. 3 * 4 * @link https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#view_cart 5 * @link https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#add_or_remove_an_item_from_a_shopping_cart 6 * @param data 7 * @returns {void} 8 */ 9function gtmSearch(data) { 10 // dataLayer.push({ecommerce: null, search_by: null, search_term: null, search_bar: null}); 11 dataLayer.push({ 12 event: "search", 13 search_by: data.searchBy, 14 search_term: data.searchTerm, 15 search_bar: data.searchBar, 16 }); 17} 18 19export default gtmSearch;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.