{"id":105490,"date":"2025-02-23T16:35:43","date_gmt":"2025-02-23T16:35:43","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/13-useful-custom-dimensions-for-google-analytics\/"},"modified":"2025-02-23T16:35:43","modified_gmt":"2025-02-23T16:35:43","slug":"13-useful-custom-dimensions-for-google-analytics","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=105490","title":{"rendered":"13 Useful Custom Dimensions For Google Analytics"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>One of my favorite (and most popular) articles in my blog is <a href=\"https:\/\/www.simoahava.com\/analytics\/improve-data-collection-with-four-custom-dimensions\/\">Improve Data Collection With Four Custom Dimensions<\/a>. In that article, I show how you can improve the quality and granularity of your <a href=\"https:\/\/analytics.google.com\/\">Google Analytics<\/a> data set with just four <a href=\"https:\/\/support.google.com\/analytics\/answer\/2709828?hl=en\">Custom Dimensions<\/a>. The reason I chose the four dimensions (Hit Timestamp, Session ID, Client ID, and User ID) is because I firmly believe that they should be in Google Analytics\u2019 <strong>standard<\/strong> set of dimensions, but for some inexplicable reason they aren\u2019t.<\/p>\n<div style=\"aspect-ratio: 1920 \/ 1080;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/13-useful-custom-dimensions.jpeg\" title=\"13 Useful Custom Dimensions For Google Analytics\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1080\" width=\"1920\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/13-useful-custom-dimensions.jpeg#ZgotmplZ\" alt=\"13 Useful Custom Dimensions For Google Analytics\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Since publishing that article three years ago, I have naturally uncovered more of these \u201cneed-to-have\u201d Custom Dimensions, and I\u2019ve written a bunch of guides on how to implement them. In this article, I want to pull all of these together into one reference guide, which you can then use to find the relevant information with ease. All of the implementation guides are for <a href=\"https:\/\/tagmanager.google.com\">Google Tag Manager<\/a>, but nothing\u2019s stopping you from modifying the JavaScript to work with <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/\">analytics.js<\/a> or <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\/\">gtag.js<\/a>.<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"1-improve-granularity\">1. Improve granularity<\/h2>\n<p>The first four Custom Dimensions are those introduced in my <a href=\"https:\/\/www.simoahava.com\/analytics\/improve-data-collection-with-four-custom-dimensions\/\">earlier article<\/a>. You can follow the link to see more details about the implementation, but some of the solutions below have been <strong>updated<\/strong>, so make sure you follow these guides rather than those in the original article.<\/p>\n<p>The <strong>purpose<\/strong> of these four dimensions is to add more information to Google Analytics data sets about the <strong>user journeys<\/strong> that take place on your site. Being able to segment and chop the data on a hit-by-hit basis (Hit Timestamp), group them into sessions (Session ID), sort by GA user (Client ID), and finally analyze cross-device paths (User ID), makes so much sense from an analytics point-of-view. It\u2019s amazing that these dimensions are not readily available in Google Analytics\u2019 data sets. They <strong>are<\/strong> available in the <a href=\"https:\/\/support.google.com\/analytics\/answer\/3437719?hl=en\">BigQuery export<\/a>\u2026<\/p>\n<div style=\"aspect-ratio: 2300 \/ 1020;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/granularity.jpg\" title=\"Improve granularity\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1020\" width=\"2300\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/granularity.jpg#ZgotmplZ\" alt=\"Improve granularity\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"11-hit-timestamp\">1.1. Hit Timestamp<\/h3>\n<p><strong>Original source<\/strong>: <a href=\"https:\/\/www.simoahava.com\/analytics\/improve-data-collection-with-four-custom-dimensions\/#4-hit-timestamp\">Link<\/a><\/p>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Hit Timestamp outputs the <strong>local<\/strong> time (i.e. visitor\u2019s browser time) of the hit in standardized format. An example would be <code>2018-05-29T15:04:51.361+03:00<\/code> (year-month-dayThour:minutes:seconds.milliseconds timezone_offset). Since it\u2019s <strong>hit<\/strong> timestamp, it\u2019s important that you add this Custom Dimensions to every single Google Analytics tag that fires on your site. Easiest way to do it is to add it to a <a href=\"https:\/\/www.simoahava.com\/analytics\/google-analytics-settings-variable-in-gtm\/\">Google Analytics Settings variable<\/a>.<\/p>\n<blockquote>\n<p>Note! It might actually be wiser to just send the UNIX timestamp (<code>new Date().getTime()<\/code>) instead of a preformatted date\/time string as below. That way it\u2019s easier to apply normalizations and transformations to the value when passed to a data warehouse, for example. But the preformatted option is better if you\u2019re just interested in viewing the data in Google Analytics.<\/p>\n<\/blockquote>\n<p><em>Thanks to <a href=\"https:\/\/www.aivosto.com\/\"><strong>Tuomas Salste<\/strong><\/a> for pointing out some bugs in the code!<\/em><\/p>\n<p><strong>Custom JavaScript variable<\/strong>: {{Hit timestamp}}<\/p>\n<p><strong>Contents<\/strong>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n    <span style=\"color:#aaa;font-style:italic\">\/\/ Get local time as ISO string with offset at the end\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>    <span style=\"color:#00a\">var<\/span> now = <span style=\"color:#00a\">new<\/span> <span style=\"color:#0aa\">Date<\/span>();\n    <span style=\"color:#00a\">var<\/span> tzo = -now.getTimezoneOffset();\n    <span style=\"color:#00a\">var<\/span> dif = tzo &gt;= <span style=\"color:#099\">0<\/span> ? <span style=\"color:#a50\">'+'<\/span> : <span style=\"color:#a50\">'-'<\/span>;\n    <span style=\"color:#00a\">var<\/span> pad = <span style=\"color:#00a\">function<\/span>(num, ms) {\n        <span style=\"color:#00a\">var<\/span> norm = <span style=\"color:#0aa\">Math<\/span>.floor(<span style=\"color:#0aa\">Math<\/span>.abs(num));\n        <span style=\"color:#00a\">if<\/span> (ms) <span style=\"color:#00a\">return<\/span> (norm 10 ? <span style=\"color:#a50\">'00'<\/span> : norm 100 ? <span style=\"color:#a50\">'0'<\/span> : <span style=\"color:#a50\">''<\/span>) + norm;\n        <span style=\"color:#00a\">return<\/span> (norm 10 ? <span style=\"color:#a50\">'0'<\/span> : <span style=\"color:#a50\">''<\/span>) + norm;\n    };\n    <span style=\"color:#00a\">return<\/span> now.getFullYear() \n        + <span style=\"color:#a50\">'-'<\/span> + pad(now.getMonth()+<span style=\"color:#099\">1<\/span>)\n        + <span style=\"color:#a50\">'-'<\/span> + pad(now.getDate())\n        + <span style=\"color:#a50\">'T'<\/span> + pad(now.getHours())\n        + <span style=\"color:#a50\">':'<\/span> + pad(now.getMinutes()) \n        + <span style=\"color:#a50\">':'<\/span> + pad(now.getSeconds())\n        + <span style=\"color:#a50\">'.'<\/span> + pad(now.getMilliseconds(), <span style=\"color:#00a\">true<\/span>)\n        + dif + pad(tzo \/ <span style=\"color:#099\">60<\/span>) \n        + <span style=\"color:#a50\">':'<\/span> + pad(tzo % <span style=\"color:#099\">60<\/span>);\n}\n<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1756 \/ 510;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/hit-timestamp.jpg\" title=\"Hit Timestamp\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"510\" width=\"1756\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/hit-timestamp.jpg#ZgotmplZ\" alt=\"Hit Timestamp\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"12-session-id\">1.2. Session ID<\/h3>\n<p><strong>Original source<\/strong>: <a href=\"https:\/\/www.simoahava.com\/analytics\/improve-data-collection-with-four-custom-dimensions\/#3-session-id\">Link<\/a><\/p>\n<p><strong>Custom Dimension scope<\/strong>: Session<\/p>\n<p>Session ID is a random, unique string (GUID) which is scoped to the entire session. This means that all hits of the same session can be queried with the same ID. This, in turn, means that you have a way of aggregating all related hits directly in the data reports, rather than having to infer them using segments, for example.<\/p>\n<p>You can add Session ID only to your Page View tag, but there\u2019s no harm in including it in every single one of your GA tags. In fact, I actually recommend just adding it to the Google Analytics Settings variable you use for all your tags, because it\u2019s possible that not all of your sessions will have a pageview in them (if the session breaks, and a new one starts without reloading a page).<\/p>\n<p><strong>Custom JavaScript variable<\/strong>: {{Random GUID}}<\/p>\n<p><strong>Contents<\/strong>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span> () { <span style=\"color:#aaa;font-style:italic\">\/\/ Public Domain\/MIT\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>    <span style=\"color:#00a\">var<\/span> d = <span style=\"color:#00a\">new<\/span> <span style=\"color:#0aa\">Date<\/span>().getTime();\n    <span style=\"color:#00a\">if<\/span> (<span style=\"color:#00a\">typeof<\/span> performance !== <span style=\"color:#a50\">'undefined'<\/span> &amp;&amp; <span style=\"color:#00a\">typeof<\/span> performance.now === <span style=\"color:#a50\">'function'<\/span>){\n        d += performance.now(); <span style=\"color:#aaa;font-style:italic\">\/\/use high-precision timer if available\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>    }\n    <span style=\"color:#00a\">return<\/span> <span style=\"color:#a50\">'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'<\/span>.replace(<span style=\"color:#099\">\/[xy]\/g<\/span>, <span style=\"color:#00a\">function<\/span> (c) {\n        <span style=\"color:#00a\">var<\/span> r = (d + <span style=\"color:#0aa\">Math<\/span>.random() * <span style=\"color:#099\">16<\/span>) % <span style=\"color:#099\">16<\/span> | <span style=\"color:#099\">0<\/span>;\n        d = <span style=\"color:#0aa\">Math<\/span>.floor(d \/ <span style=\"color:#099\">16<\/span>);\n        <span style=\"color:#00a\">return<\/span> (c === <span style=\"color:#a50\">'x'<\/span> ? r : (r &amp; <span style=\"color:#099\">0x3<\/span> | <span style=\"color:#099\">0x8<\/span>)).toString(<span style=\"color:#099\">16<\/span>);\n    });\n}\n<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1746 \/ 604;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/random-guid.jpg\" title=\"Session ID\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"604\" width=\"1746\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/random-guid.jpg#ZgotmplZ\" alt=\"Session ID\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"13-client-id\">1.3. Client ID<\/h3>\n<p><strong>Original source<\/strong>: <a href=\"https:\/\/www.simoahava.com\/analytics\/improve-data-collection-with-four-custom-dimensions\/#2-client-id\">Link<\/a><\/p>\n<p><strong>Custom Dimension scope<\/strong>: User<\/p>\n<p>Client ID is the <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/cookies-user-id\">anonymous cookie identifier<\/a> that Google Analytics assigns to every single browser instance of any given web visitor. It\u2019s how GA calculates the <strong>Users<\/strong> metric in views which don\u2019t have the User ID feature enabled (more on this in the next chapter).<\/p>\n<p>Sending the Client ID as a Custom Dimension to Google Analytics is absolutely necessary. It\u2019s the only way to get row-by-row reports split by user, and it\u2019s the only way to query for data collected from any anonymous user.<\/p>\n<p>The Client ID is collected using <code>customTask<\/code> (guide <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/use-customtask-access-tracker-values-google-tag-manager\/\">here<\/a>), so you do not add it to tags using the <strong>Custom Dimensions<\/strong> settings. Instead, you add it to <strong>Fields to set<\/strong> -&gt; <code>customTask<\/code> (see screenshot below). Be sure to read my guide on <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\"><code>customTask<\/code><\/a> to understand how this mechanism works.<\/p>\n<p><strong>Custom JavaScript variable<\/strong>: {{customTask &#8211; Client ID}}<\/p>\n<p><strong>Contents<\/strong>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#00a\">var<\/span> clientIdIndex = <span style=\"color:#099\">3<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the actual Custom Dimension index number\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(model) {\n    model.set(<span style=\"color:#a50\">'dimension'<\/span> + clientIdIndex, model.get(<span style=\"color:#a50\">'clientId'<\/span>));\n  };\n}\n<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1672 \/ 428;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/customtask-client-id.jpg\" title=\"customTask Client ID\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"428\" width=\"1672\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/customtask-client-id.jpg#ZgotmplZ\" alt=\"customTask Client ID\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"14-user-id\">1.4. User ID<\/h3>\n<p><strong>Original source<\/strong>: <a href=\"https:\/\/www.simoahava.com\/analytics\/improve-data-collection-with-four-custom-dimensions\/#5-user-id\">Link<\/a><\/p>\n<p><strong>Custom Dimension scope<\/strong>: User<\/p>\n<p>User ID is an identifier that you have somehow linked to the logged in user. Typically it\u2019s a pseudonymized key written into <code>dataLayer<\/code> using an identifier attached to the user in your CRM or some other server-side user registry.<\/p>\n<p>Because there are so many ways to implement User ID, depending on how your backend produces the identifier, I do not have a generic guide on how to generate the value. Thus the instructions below apply only to a very specific use case, where the User ID is written to the <code>dataLayer<\/code> when the page is loaded. But you could just as well have your web server write the User ID in some other global variable, or even in a browser cookie.<\/p>\n<p>Also, because you are collecting data from logged in users, make sure whatever solution you implement is compliant with the privacy legislation and regulations of your region.<\/p>\n<p><strong>Data Layer variable<\/strong>: {{DLV &#8211; userId}}<\/p>\n<p><strong>Contents<\/strong>: Data Layer Variable Name &#8211; <code>userId<\/code><\/p>\n<div style=\"aspect-ratio: 1660 \/ 866;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/user-id.jpg\" title=\"User ID Data Layer\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"866\" width=\"1660\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/user-id.jpg#ZgotmplZ\" alt=\"User ID Data Layer\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h2 id=\"2-good-all-around-custom-dimensions\">2. Good all-around Custom Dimensions<\/h2>\n<p>The next set of Custom Dimensions are just <strong>smart<\/strong> things to add to your data collection. Since they are included in this guide, they aren\u2019t queriable by default in GA\u2019s reporting interface.<\/p>\n<div style=\"aspect-ratio: 2296 \/ 542;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/useful-dimensions.jpg\" title=\"Useful dimensions\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"542\" width=\"2296\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/useful-dimensions.jpg#ZgotmplZ\" alt=\"Useful dimensions\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"21-hit-type\">2.1. Hit Type<\/h3>\n<p><strong>Original source<\/strong>: <a href=\"https:\/\/www.simoahava.com\/analytics\/add-hit-type-custom-dimension\/\">Link<\/a><\/p>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Hit Type tells you explicitly what the <em>type<\/em> of hit collected in Google Analytics was. So it would be <code>event<\/code> for Events, <code>pageview<\/code> for Pageviews, <code>timing<\/code> for Timing hits, etc. You can use this to build segments (e.g. sessions where the first hit was an event), or to add more granularity to path analysis.<\/p>\n<p>You should add the variable to every single Google Analytics tag in your container. The variable needs to be added using <code>customTask<\/code>. Be sure to read my guide on <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\"><code>customTask<\/code><\/a> to understand how this mechanism works.<\/p>\n<p><strong>Custom JavaScript variable<\/strong>: {{customTask &#8211; Hit type}}<\/p>\n<p><strong>Contents<\/strong>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#00a\">var<\/span> hitTypeIndex = <span style=\"color:#099\">5<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the actual Custom Dimension index number\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(model) {\n    model.set(<span style=\"color:#a50\">'dimension'<\/span> + hitTypeIndex, model.get(<span style=\"color:#a50\">'hitType'<\/span>));\n  };\n}\n<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1760 \/ 954;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/customtask-hit-type.jpg\" title=\"hit type customTask\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"954\" width=\"1760\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/customtask-hit-type.jpg#ZgotmplZ\" alt=\"hit type customTask\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"22-full-referrer\">2.2. Full Referrer<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Full Referrer is simply the value of <code>document.referrer<\/code> added as a hit-scoped Custom Dimension to every single Google Analytics tag in your container. This will let you analyze what the <strong>previous page<\/strong> of any given hit was. This makes a lot of sense for pageview tracking, and it makes a lot of sense for hits that start sessions, since you can now analyze the referral information for sessions that came via some other source than a referral hit.<\/p>\n<p><strong>JavaScript variable<\/strong>: {{document.referrer}}<\/p>\n<p><strong>Contents<\/strong>: Global Variable Name &#8211; <code>document.referrer<\/code><\/p>\n<div style=\"aspect-ratio: 1762 \/ 1052;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/document-referrer.jpg\" title=\"document referrer\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1052\" width=\"1762\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/document-referrer.jpg#ZgotmplZ\" alt=\"document referrer\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"23-payload-length\">2.3. Payload Length<\/h3>\n<p><strong>Original source<\/strong>: <a href=\"https:\/\/www.simoahava.com\/analytics\/send-google-analytics-payload-length-as-custom-dimension\/\">Link<\/a><\/p>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>You can send the payload length of every single Google Analytics hit by adding this hit-scoped Custom Dimension to every single tag in your container. The idea is that you can monitor if you are approaching the <strong>8192<\/strong> byte limit, since hits that equal or surpass that limit will <strong>not get sent to Google Analytics<\/strong>.<\/p>\n<p>The solution is added using <code>customTask<\/code>. Be sure to read my guide on <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\"><code>customTask<\/code><\/a> to understand how this mechanism works.<\/p>\n<p><strong>Custom JavaScript variable<\/strong>: {{customTask &#8211; Hit payload length}}<\/p>\n<p><strong>Contents<\/strong>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#aaa;font-style:italic\">\/\/ Change this index to match that of the Custom Dimension you created in GA\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> customDimensionIndex = <span style=\"color:#099\">7<\/span>;\n  \n  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(model) {\n    \n    <span style=\"color:#00a\">var<\/span> globalSendTaskName = <span style=\"color:#a50\">'_'<\/span> + model.get(<span style=\"color:#a50\">'trackingId'<\/span>) + <span style=\"color:#a50\">'_sendHitTask'<\/span>;\n    \n    <span style=\"color:#00a\">var<\/span> originalSendHitTask = <span style=\"color:#0aa\">window<\/span>[globalSendTaskName] = <span style=\"color:#0aa\">window<\/span>[globalSendTaskName] || model.get(<span style=\"color:#a50\">'sendHitTask'<\/span>);\n    \n    model.set(<span style=\"color:#a50\">'sendHitTask'<\/span>, <span style=\"color:#00a\">function<\/span>(sendModel) {\n      \n      <span style=\"color:#00a\">try<\/span> {\n        \n        <span style=\"color:#00a\">var<\/span> originalHitPayload = sendModel.get(<span style=\"color:#a50\">'hitPayload'<\/span>);\n        \n        <span style=\"color:#00a\">var<\/span> hitPayload = sendModel.get(<span style=\"color:#a50\">'hitPayload'<\/span>);\n        <span style=\"color:#00a\">var<\/span> customDimensionParameter = <span style=\"color:#a50\">'&amp;cd'<\/span> + customDimensionIndex;\n      \n        <span style=\"color:#aaa;font-style:italic\">\/\/ If hitPayload already has that Custom Dimension, note this in the console and do not overwrite the existing dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>      \n        <span style=\"color:#00a\">if<\/span> (hitPayload.indexOf(customDimensionParameter + <span style=\"color:#a50\">'='<\/span>) &gt; -<span style=\"color:#099\">1<\/span>) {\n          \n          console.log(<span style=\"color:#a50\">'Google Analytics error: tried to send hit payload length in an already assigned Custom Dimension'<\/span>);\n          originalSendHitTask(sendModel);\n        \n        } <span style=\"color:#00a\">else<\/span> {\n      \n        <span style=\"color:#aaa;font-style:italic\">\/\/ Otherwise add the Custom Dimension to the string\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>        <span style=\"color:#aaa;font-style:italic\">\/\/ together with the complete length of the payload\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>          hitPayload += customDimensionParameter + <span style=\"color:#a50\">'='<\/span>;\n          hitPayload += (hitPayload.length + hitPayload.length.toString().length);\n        \n          sendModel.set(<span style=\"color:#a50\">'hitPayload'<\/span>, hitPayload, <span style=\"color:#00a\">true<\/span>);\n          originalSendHitTask(sendModel);\n        \n        }\n      } <span style=\"color:#00a\">catch<\/span>(e) {\n       \n        console.error(<span style=\"color:#a50\">'Error sending hit payload length to Google Analytics'<\/span>);\n        sendModel.set(<span style=\"color:#a50\">'hitPayload'<\/span>, originalHitPayload, <span style=\"color:#00a\">true<\/span>);\n        originalSendHitTask(sendModel);\n        \n      }\n    });\n  };\n}\n<\/code><\/pre>\n<\/div>\n<div style=\"aspect-ratio: 1756 \/ 1054;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/hit-payload-length.jpg\" title=\"Hit payload length\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1054\" width=\"1756\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/hit-payload-length.jpg#ZgotmplZ\" alt=\"Hit payload length\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"24-gtm-container-id\">2.4. GTM Container ID<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>This is another of those no-brainer Custom Dimensions. Sending the Container ID serves multiple purposes: It helps you identify valid hits from spam (particularly spam sent from outside your site), it helps you debug data in a situation where you have more than one container running on the site, and it makes it easy to run parallel installations of Universal Analytics (or Global Site Tag) and Google Tag Manager.<\/p>\n<p>You need to activate the <strong>Container ID<\/strong> <a href=\"https:\/\/www.simoahava.com\/analytics\/variable-guide-google-tag-manager\/#built-in-variables\">Built-in variable<\/a> for this. Add the variable to your Google Analytics Settings variable, so that it\u2019s added to every single Google Analytics tag in your container.<\/p>\n<div style=\"aspect-ratio: 1768 \/ 1150;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/container-id.jpg\" title=\"Container ID\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1150\" width=\"1768\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/container-id.jpg#ZgotmplZ\" alt=\"Container ID\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h2 id=\"3-browsing-behavior\">3. Browsing behavior<\/h2>\n<p>The final set of Custom Dimensions is all about tracking <a href=\"https:\/\/www.simoahava.com\/analytics\/track-browsing-behavior-in-google-analytics\/\">browsing behavior<\/a>. Follow the link in the previous sentence to read a thorough guide on how and why to track browsing behavior in Google Analytics.<\/p>\n<p>Suffice to say that by adding these dimensions to your data collection, you can make more sense out of how users navigate to, navigate on, and navigate away from your site. It\u2019s finally possible to segment your data based on how your visitors open pages in browser tabs, do they navigate with the browser\u2019s Back and Forward buttons, and how many tabs they have open at any given time!<\/p>\n<p>Instead of adding solution-specific implementation information, please follow the steps in the <a href=\"https:\/\/www.simoahava.com\/analytics\/track-browsing-behavior-in-google-analytics\/\">original guide<\/a>.<\/p>\n<div style=\"aspect-ratio: 2308 \/ 1006;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/browsing-behavior.jpg\" title=\"Browsing behavior\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1006\" width=\"2308\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/browsing-behavior.jpg#ZgotmplZ\" alt=\"Browsing behavior\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"31-redirect-count\">3.1. Redirect Count<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Redirect count is the number of times the initial document request was redirected when the user loaded the current page. There are some inconsistencies here, and I haven\u2019t been able to deduce a consistent description of <code>redirectCount<\/code> behavior. However, if it works as it should, it offers interesting data about how your site responds to requests, especially when combined with organic search traffic, for example.<\/p>\n<p><strong>Data Layer variable<\/strong>: {{DLV &#8211; browsingBehavior.redirectCount}}<\/p>\n<p><strong>Contents<\/strong>: Data Layer Variable Name &#8211; <code>browsingBehavior.redirectCount<\/code><\/p>\n<div style=\"aspect-ratio: 1760 \/ 1188;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/redirect-count.jpg\" title=\"Redirect count\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1188\" width=\"1760\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/redirect-count.jpg#ZgotmplZ\" alt=\"Redirect count\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"32-navigation-type\">3.2. Navigation Type<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Navigation type means the method of navigating to the current page. This includes values such as <code>NAVIGATE<\/code> (user wrote the address in the address bar or clicked a link to the current page), <code>RELOAD<\/code> (user reloaded the page), <code>BACK \/ FORWARD<\/code> (user clicked the browser\u2019s back or forward buttons) and <code>OTHER<\/code> (some other way of navigating to the page.<\/p>\n<p><strong>Data Layer variable<\/strong>: {{DLV &#8211; browsingBehavior.navigationType}}<\/p>\n<p><strong>Contents<\/strong>: Data Layer Variable Name &#8211; <code>browsingBehavior.navigationType<\/code><\/p>\n<div style=\"aspect-ratio: 1690 \/ 1164;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/navigation-type.jpg\" title=\"Navigation type\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1164\" width=\"1690\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/navigation-type.jpg#ZgotmplZ\" alt=\"Navigation type\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"33-tab-type\">3.3. Tab Type<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Tab type indicates whether the page load occurred in a newly open tab, or whether the tab already existed. This is done by storing the current <code>tabId<\/code> into <code>sessionStorage<\/code>. If the storage doesn\u2019t have the current tab ID, we can deduce that the tab is a new one, since <code>sessionStorage<\/code> is purged when the tab is closed.<\/p>\n<p><strong>Data Layer variable<\/strong>: {{DLV &#8211; browsingBehavior.newTab}}<\/p>\n<p><strong>Contents<\/strong>: Data Layer Variable Name &#8211; <code>browsingBehavior.newTab<\/code><\/p>\n<div style=\"aspect-ratio: 1702 \/ 1282;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/tab-type.jpg\" title=\"Tab type\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1282\" width=\"1702\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/tab-type.jpg#ZgotmplZ\" alt=\"Tab type\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"34-tabs-open\">3.4. Tabs Open<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>Tabs open returns the number of tabs currently open in the browser. This is based on a count of currently active tab IDs stored in <code>localStorage<\/code>. This counter isn\u2019t 100% reliable, because it relies on a number of moving parts which might not always be in sync. But as an indicator it\u2019s very useful, since it tells you how your content is typically being digested.<\/p>\n<p><strong>Data Layer variable<\/strong>: {{DLV &#8211; browsingBehavior.tabCount}}<\/p>\n<p><strong>Contents<\/strong>: Data Layer Variable Name &#8211; <code>browsingBehavior.tabCount<\/code><\/p>\n<div style=\"aspect-ratio: 1688 \/ 1358;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/tabs-open.jpg\" title=\"Tabs open\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1358\" width=\"1688\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/tabs-open.jpg#ZgotmplZ\" alt=\"Tabs open\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"35-tab-id\">3.5. Tab ID<\/h3>\n<p><strong>Custom Dimension scope<\/strong>: Hit<\/p>\n<p>The final cog in the machine is the ID of the current tab. This is useful in case you want to group hits together by the tab in which they occurred.<\/p>\n<p><strong>Data Layer variable<\/strong>: {{DLV &#8211; browsingBehavior.tabId}}<\/p>\n<p><strong>Contents<\/strong>: Data Layer Variable Name &#8211; <code>browsingBehavior.tabId<\/code><\/p>\n<div style=\"aspect-ratio: 1698 \/ 1456;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/05\/tab-id.jpg\" title=\"Tab ID\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1456\" width=\"1698\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/05\/tab-id.jpg#ZgotmplZ\" alt=\"Tab ID\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h2 id=\"4-the-customtask-variable\">4. The <code>customTask<\/code> variable<\/h2>\n<p>You might have noticed that a number of the solutions in this guide utilize <code>customTask<\/code>. I might have recommended you to read my <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\"><code>customTask<\/code> guide<\/a>, too!<\/p>\n<p>One of the things you\u2019ll learn in the guide is that you can only have one <code>customTask<\/code> per tag. That means that if you want to implement <strong>all<\/strong> the Custom Dimensions in this article, you will need to combine <strong>three<\/strong> different <code>customTask<\/code> solutions into a single Custom JavaScript variable.<\/p>\n<p>This is fairly easy to do, since it\u2019s more or less just copy-pasting all the code into one long anonymous <code>function<\/code>, but I\u2019ll show you how to do it nevertheless.<\/p>\n<p>This is the Custom JavaScript variable you\u2019ll be using:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#00a\">var<\/span> clientIdIndex = <span style=\"color:#099\">3<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the index of your Client ID Custom Dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> hitTypeIndex = <span style=\"color:#099\">5<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the index of your Hit Type Custom Dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> payloadLengthIndex = <span style=\"color:#099\">7<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the index of your Payload Length Custom Dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(model) {\n    <span style=\"color:#00a\">var<\/span> globalSendTaskName, originalSendHitTask, originalHitPayload, hitPayload, customDimensionParameter;\n    \n    <span style=\"color:#00a\">if<\/span> (<span style=\"color:#00a\">typeof<\/span> clientIdIndex === <span style=\"color:#a50\">'number'<\/span>) {\n      model.set(<span style=\"color:#a50\">'dimension'<\/span> + clientIdIndex, model.get(<span style=\"color:#a50\">'clientId'<\/span>));\n    }\n    \n    <span style=\"color:#00a\">if<\/span> (<span style=\"color:#00a\">typeof<\/span> hitTypeIndex === <span style=\"color:#a50\">'number'<\/span>) {\n      model.set(<span style=\"color:#a50\">'dimension'<\/span> + hitTypeIndex, model.get(<span style=\"color:#a50\">'hitType'<\/span>));\n    }\n    \n    <span style=\"color:#00a\">if<\/span> (<span style=\"color:#00a\">typeof<\/span> payloadLengthIndex === <span style=\"color:#a50\">'number'<\/span>) {\n      globalSendTaskName = <span style=\"color:#a50\">'_'<\/span> + model.get(<span style=\"color:#a50\">'trackingId'<\/span>) + <span style=\"color:#a50\">'_sendHitTask'<\/span>;\n    \n      originalSendHitTask = <span style=\"color:#0aa\">window<\/span>[globalSendTaskName] = <span style=\"color:#0aa\">window<\/span>[globalSendTaskName] || model.get(<span style=\"color:#a50\">'sendHitTask'<\/span>);\n    \n      model.set(<span style=\"color:#a50\">'sendHitTask'<\/span>, <span style=\"color:#00a\">function<\/span>(sendModel) {\n      \n        <span style=\"color:#00a\">try<\/span> {\n        \n          originalHitPayload = sendModel.get(<span style=\"color:#a50\">'hitPayload'<\/span>);\n        \n          hitPayload = sendModel.get(<span style=\"color:#a50\">'hitPayload'<\/span>);\n          customDimensionParameter = <span style=\"color:#a50\">'&amp;cd'<\/span> + payloadLengthIndex;\n      \n          <span style=\"color:#aaa;font-style:italic\">\/\/ If hitPayload already has that Custom Dimension, note this in the console and do not overwrite the existing dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>      \n          <span style=\"color:#00a\">if<\/span> (hitPayload.indexOf(customDimensionParameter + <span style=\"color:#a50\">'='<\/span>) &gt; -<span style=\"color:#099\">1<\/span>) {\n          \n            console.log(<span style=\"color:#a50\">'Google Analytics error: tried to send hit payload length in an already assigned Custom Dimension'<\/span>);\n            originalSendHitTask(sendModel);\n        \n          } <span style=\"color:#00a\">else<\/span> {\n      \n            <span style=\"color:#aaa;font-style:italic\">\/\/ Otherwise add the Custom Dimension to the string\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>            <span style=\"color:#aaa;font-style:italic\">\/\/ together with the complete length of the payload\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>            hitPayload += customDimensionParameter + <span style=\"color:#a50\">'='<\/span>;\n            hitPayload += (hitPayload.length + hitPayload.length.toString().length);\n        \n            sendModel.set(<span style=\"color:#a50\">'hitPayload'<\/span>, hitPayload, <span style=\"color:#00a\">true<\/span>);\n            originalSendHitTask(sendModel);\n        \n          }\n          \n        } <span style=\"color:#00a\">catch<\/span>(e) {\n       \n          console.error(<span style=\"color:#a50\">'Error sending hit payload length to Google Analytics'<\/span>);\n          sendModel.set(<span style=\"color:#a50\">'hitPayload'<\/span>, originalHitPayload, <span style=\"color:#00a\">true<\/span>);\n          originalSendHitTask(sendModel);\n        \n        }\n      \n      });\n    }\n  };\n}\n<\/code><\/pre>\n<\/div>\n<p>If you want to drop any of the three solutions from this <code>customTask<\/code>, simply remove or comment out the respective <code>var ...Index = N;<\/code> line. For example, if you don\u2019t need to collect the payload length, change the code appropriately:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#00a\">var<\/span> clientIdIndex = <span style=\"color:#099\">3<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the index of your Client ID Custom Dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> hitTypeIndex = <span style=\"color:#099\">5<\/span>; <span style=\"color:#aaa;font-style:italic\">\/\/ Change this number to the index of your Hit Type Custom Dimension\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  \n  <span style=\"color:#aaa;font-style:italic\">\/\/ var payloadLengthIndex = 7;\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  \n  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(model) {\n    ...\n<\/code><\/pre>\n<\/div>\n<h2 id=\"summary\">Summary<\/h2>\n<p>This list of Custom Dimensions is certainly not exhaustive, and I\u2019m sure you have other suggestions to what could be considered \u201cuseful\u201d.<\/p>\n<p>One thing to keep in mind is the restriction of just 20 available Custom Dimension slots in the free version of Google Analytics. This is very unfortunate, and one of the main gripes I have with GA. So it\u2019s very likely you\u2019re forced to prioritize just which dimension you\u2019ll need to be adding to your data collection. If push comes to shove, I would personally be fine with ignoring the five Browsing Behavior dimensions, and just focus on the 8 dimensions listed first in this article.<\/p>\n<p>Regardless, I consider these Custom Dimensions to add much-needed granularity to GA data. Many of these dimensions are available by default only in the BigQuery export, which, in turn, is mainly available for Google Analytics 360 customers. So by adding these dimensions to your data set, you are, in a way, actually saving money.<\/p>\n<p>Do you have some go-to Custom Dimensions you\u2019d recommend others add to their data collection right this instant? Let us know in the comments.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>One of my favorite (and most popular) articles in my blog is Improve Data Collection With Four Custom Dimensions. In that article, I show how you can improve the quality and granularity of your Google Analytics data set with just four Custom Dimensions. The reason I chose the four dimensions (Hit Timestamp, Session ID, Client [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":105492,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[12765,834,25354,1531],"dealstore":[],"offerexpiration":[],"class_list":["post-105490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-analytics","tag-custom","tag-dimensions","tag-google"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>13 Useful Custom Dimensions For Google Analytics - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=105490\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"13 Useful Custom Dimensions For Google Analytics - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"One of my favorite (and most popular) articles in my blog is Improve Data Collection With Four Custom Dimensions. In that article, I show how you can improve the quality and granularity of your Google Analytics data set with just four Custom Dimensions. The reason I chose the four dimensions (Hit Timestamp, Session ID, Client [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=105490\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-23T16:35:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2300\" \/>\n\t<meta property=\"og:image:height\" content=\"1020\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=105490#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=105490\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"13 Useful Custom Dimensions For Google Analytics\",\"datePublished\":\"2025-02-23T16:35:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=105490\"},\"wordCount\":2222,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=105490#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg\",\"keywords\":[\"Analytics\",\"Custom\",\"Dimensions\",\"Google\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=105490#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=105490\",\"url\":\"https:\/\/fivemor.com\/?p=105490\",\"name\":\"13 Useful Custom Dimensions For Google Analytics - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=105490#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=105490#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg\",\"datePublished\":\"2025-02-23T16:35:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=105490#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=105490\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=105490#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg\",\"width\":2300,\"height\":1020},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=105490#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"13 Useful Custom Dimensions For Google Analytics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"13 Useful Custom Dimensions For Google Analytics - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=105490","og_locale":"en_US","og_type":"article","og_title":"13 Useful Custom Dimensions For Google Analytics - Som2ny Network","og_description":"One of my favorite (and most popular) articles in my blog is Improve Data Collection With Four Custom Dimensions. In that article, I show how you can improve the quality and granularity of your Google Analytics data set with just four Custom Dimensions. The reason I chose the four dimensions (Hit Timestamp, Session ID, Client [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=105490","og_site_name":"Som2ny Network","article_published_time":"2025-02-23T16:35:43+00:00","og_image":[{"width":2300,"height":1020,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=105490#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=105490"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"13 Useful Custom Dimensions For Google Analytics","datePublished":"2025-02-23T16:35:43+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=105490"},"wordCount":2222,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=105490#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg","keywords":["Analytics","Custom","Dimensions","Google"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=105490#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=105490","url":"https:\/\/fivemor.com\/?p=105490","name":"13 Useful Custom Dimensions For Google Analytics - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=105490#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=105490#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg","datePublished":"2025-02-23T16:35:43+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=105490#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=105490"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=105490#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/granularity.jpg","width":2300,"height":1020},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=105490#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"13 Useful Custom Dimensions For Google Analytics"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/105490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=105490"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/105490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/105492"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=105490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=105490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=105490"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=105490"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=105490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}