{"id":3462,"date":"2023-09-29T07:22:25","date_gmt":"2023-09-29T12:22:25","guid":{"rendered":"https:\/\/promincproductions.com\/blog\/?p=3462"},"modified":"2023-09-29T07:24:06","modified_gmt":"2023-09-29T12:24:06","slug":"ga4-item-parameter-reference-chart","status":"publish","type":"post","link":"https:\/\/promincproductions.com\/blog\/ga4-item-parameter-reference-chart\/","title":{"rendered":"GA4 Item Parameter Reference Chart"},"content":{"rendered":"<p>I wrote up this GA4 Item Parameter list as I was debugging some GA4 item changes today using one of my favorite Chrome extensions today &#8211; <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/omnibug\/bknpehncffejahipecakbfkomebjmokl\" target=\"_blank\" rel=\"noopener\" data-lasso-id=\"969\">Omnibug<\/a> &#8211; to see what data was being sent. The problem though is that my nice parameters<\/p>\n\n\n\n<p>As you may know, the <code>items<\/code> array gets sent for MANY GA4 events (ie. <code>add_to_cart<\/code>, <code>select_item<\/code>, etc.) and if the data doesn&#8217;t match extremely closely, then the reports in GA4 result in being less than reliable\u2026<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"600\" height=\"600\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/09\/GA4-Item-Parameter-List.png\" alt=\"GA4 Item Parameter Reference Chart\" class=\"wp-image-3463\" title=\"GA4 Item Parameter Reference Chart\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/09\/GA4-Item-Parameter-List.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/09\/GA4-Item-Parameter-List-500x500.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/09\/GA4-Item-Parameter-List-150x150.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/09\/GA4-Item-Parameter-List-450x450.png 450w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n<\/div>\n\n\n<p>You&#8217;ll notice that the item data gets put into a serialized array (GA4&#8217;s custom format\u2026) with parameter names that are shortened and not quite as recognizable.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"id12345~nmAwesome Product Name~lihome_page~lnHome Page~lp2~brAwesome Brand~pr99.99~qt1\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">GA4 Item Array Code Chart<\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Item Array Name<\/th><th>Serialized Array Key<\/th><\/tr><\/thead><tbody><tr><td><code>item_id<\/code><\/td><td><code>id<\/code><\/td><\/tr><tr><td><code>item_name<\/code><\/td><td><code>nm<\/code><\/td><\/tr><tr><td><code>affiliation<\/code><\/td><td><code>af<\/code><\/td><\/tr><tr><td><code>coupon<\/code><\/td><td><code>cp<\/code><\/td><\/tr><tr><td><code>discount<\/code><\/td><td><code>ds<\/code><\/td><\/tr><tr><td><code>index<\/code><\/td><td><code>lp<\/code><\/td><\/tr><tr><td><code>item_brand<\/code><\/td><td><code>br<\/code><\/td><\/tr><tr><td><code>item_category<\/code><\/td><td><code>ca<\/code><\/td><\/tr><tr><td><code>item_category2<\/code><\/td><td><code>c2<\/code><\/td><\/tr><tr><td><code>item_category3<\/code><\/td><td><code>c3<\/code><\/td><\/tr><tr><td><code>item_category4<\/code><\/td><td><code>c4<\/code><\/td><\/tr><tr><td><code>item_category5<\/code><\/td><td><code>c5<\/code><\/td><\/tr><tr><td><code>item_list_id<\/code><\/td><td><code>li<\/code><\/td><\/tr><tr><td><code>item_list_name<\/code><\/td><td><code>ln<\/code><\/td><\/tr><tr><td><code>item_variant<\/code><\/td><td><code>va<\/code><\/td><\/tr><tr><td><code>location_id<\/code><\/td><td><code>lo<\/code><\/td><\/tr><tr><td><code>price<\/code><\/td><td><code>pr<\/code><\/td><\/tr><tr><td><code>quantity<\/code><\/td><td><code>qt<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Custom Parameters<\/h2>\n\n\n\n<p>Custom parameters can be sent in the GA4 items array. Since GA4 doesn&#8217;t know what the parameter names are, custom key value parameters are passed. The key is passed via a <code>k{index_number}<\/code> parameter and the value is passed via a <code>v{index_number}<\/code> parameter.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gtag(\"event\", \"add_to_cart\", {\n  currency: \"USD\",\n  value: 99.99,\n  items: &#091;\n    {\n      item_id: \"12345\",\n      item_name: \"Awesome Product Name\",\n      index: 2,\n      item_brand: \"Awesome Brand\",\n      item_list_id: \"home_page\",\n      item_list_name: \"Home Page\",\n      price: 99.99,\n      quantity: 1,\n      custom_one: \"hello world\",\n      custom_two: \"foo bar\"\n    }\n  ]\n});<\/code><\/pre>\n\n\n\n<p>The resulting string that will be sent to GA4 will look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"id12345~nmAwesome Product Name~lihome_page~lnHome Page~lp2~brAwesome Brand~pr99.99~qt1&lt;\/code&gt;~k0custom_one~v0hello world~k1custom_two~v1foo bar<\/code><\/pre>\n\n\n\n<p>Notice <code>k0<\/code> and <code>v0<\/code> for the custom parameter at <code>index_number<\/code> <code>0<\/code> and <code>k1<\/code> and <code>v1<\/code> for the custom parameter at <code>index_number<\/code> <code>1<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>I wrote up this GA4 Item Parameter list as I was debugging some GA4 item changes today using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3463,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[50,5],"tags":[512,511,513],"class_list":["post-3462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","category-website-development","tag-analytics","tag-ga4","tag-google-analytics"],"jetpack_featured_media_url":"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/09\/GA4-Item-Parameter-List.png","jetpack_shortlink":"https:\/\/wp.me\/p4BbcR-TQ","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/3462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/comments?post=3462"}],"version-history":[{"count":2,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/3462\/revisions"}],"predecessor-version":[{"id":3468,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/3462\/revisions\/3468"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/media\/3463"}],"wp:attachment":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/media?parent=3462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/categories?post=3462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/tags?post=3462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}