{"id":104134,"date":"2025-02-22T22:14:13","date_gmt":"2025-02-22T22:14:13","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/create-and-update-google-analytics-session-timeout-cookie\/"},"modified":"2025-02-22T22:14:13","modified_gmt":"2025-02-22T22:14:13","slug":"create-and-update-google-analytics-session-timeout-cookie","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=104134","title":{"rendered":"Create And Update Google Analytics Session Timeout Cookie"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>In <a href=\"https:\/\/analytics.google.com\/\">Google Analytics<\/a>, the concept of a <strong>session<\/strong> is the key aggregation unit of all the data you work with. It\u2019s so central to all the key metrics you use (Conversion Rate, Bounce Rate, Session Duration, Landing Page), and yet there\u2019s <a href=\"https:\/\/www.slideshare.net\/SimoAhava\/essential-search-marketing-tweaks-for-google-analytics-and-google-tag-manager\/38\">an underlying complexity<\/a> that I\u2019m pretty certain is unrecognized by many of GA\u2019s users. And yet, since this idea of a session is so focal to GA (to the point of being <a href=\"https:\/\/www.simoahava.com\/analytics\/the-schema-conspiracy\/\">overbearing<\/a>), it\u2019s annoying that the <strong>browser<\/strong> isn\u2019t privy to any of the sessionization parameters that Google Analytics applies to the hits sent from the browser to its servers.<\/p>\n<p>Well, to rectify this, I\u2019ve written a very simple <a href=\"https:\/\/www.simoahava.com\/tags\/customtask\/\"><code>customTask<\/code><\/a> solution, which basically mimics the session timeout (30 minutes by default) in a browser cookie. You can use this cookie for a number things, such as preventing <strong>event<\/strong> hits from being dispatched if the session has timed out, or for turning these event hits into <strong>non-interactive<\/strong> hits.<\/p>\n<div style=\"aspect-ratio: 719 \/ 128;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/08\/update-session-cookie.jpg\" title=\"Update session cookie Google Analytics\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"128\" width=\"719\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/08\/update-session-cookie.jpg#ZgotmplZ\" alt=\"Update session cookie Google Analytics\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Naturally, I have also updated my <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\">guide to <code>customTask<\/code><\/a> as well as my <a href=\"https:\/\/www.simoahava.com\/tools\/customtask-builder\/\">customTask Builder tool<\/a> with this trick, so you can start using it with all the other cool <code>customTask<\/code> tricks out there!<\/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=\"the-customtask-code\">The <code>customTask<\/code> code<\/h2>\n<p>Here\u2019s what the <code>customTask<\/code> method looks like:<\/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\">var<\/span> _customTask = <span style=\"color:#00a\">function<\/span>() {\n  <span style=\"color:#aaa;font-style:italic\">\/\/ Update expiresMs to be the number of milliseconds when the cookie should expire.\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ Update domain to match the parent domain of your website.\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> updateSessionCookie = {\n    expiresMs: <span style=\"color:#099\">1000<\/span>*<span style=\"color:#099\">60<\/span>*<span style=\"color:#099\">30<\/span>,\n    domain: <span style=\"color:#a50\">'mydomain.com'<\/span>\n  };\n\n  <span style=\"color:#aaa;font-style:italic\">\/\/ DO NOT EDIT ANYTHING BELOW THIS LINE\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> globalSendHitTaskName   = <span style=\"color:#a50\">'_ga_originalSendHitTask'<\/span>;\n\n  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(customTaskModel) {\n\n    <span style=\"color:#0aa\">window<\/span>[globalSendHitTaskName] = <span style=\"color:#0aa\">window<\/span>[globalSendHitTaskName] || customTaskModel.get(<span style=\"color:#a50\">'sendHitTask'<\/span>);\n\n    customTaskModel.set(<span style=\"color:#a50\">'sendHitTask'<\/span>, <span style=\"color:#00a\">function<\/span>(sendHitTaskModel) {\n\n      <span style=\"color:#00a\">var<\/span> originalSendHitTaskModel = sendHitTaskModel,\n          originalSendHitTask      = <span style=\"color:#0aa\">window<\/span>[globalSendHitTaskName];\n\n      <span style=\"color:#00a\">var<\/span> hitType, nonInteraction, d;\n\n      <span style=\"color:#00a\">try<\/span> {\n        originalSendHitTask(sendHitTaskModel);\n\n        <span style=\"color:#aaa;font-style:italic\">\/\/ updateSessionCookie\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>        <span style=\"color:#00a\">if<\/span> (<span style=\"color:#00a\">typeof<\/span> updateSessionCookie === <span style=\"color:#a50\">'object'<\/span> &amp;&amp; updateSessionCookie.hasOwnProperty(<span style=\"color:#a50\">'expiresMs'<\/span>) &amp;&amp; updateSessionCookie.hasOwnProperty(<span style=\"color:#a50\">'domain'<\/span>)) {\n          hitType = sendHitTaskModel.get(<span style=\"color:#a50\">'hitType'<\/span>);\n          nonInteraction = sendHitTaskModel.get(<span style=\"color:#a50\">'nonInteraction'<\/span>);\n          <span style=\"color:#00a\">if<\/span> (nonInteraction !== <span style=\"color:#00a\">true<\/span> &amp;&amp; (hitType === <span style=\"color:#a50\">'pageview'<\/span> || hitType === <span style=\"color:#a50\">'event'<\/span>)) {\n            d = <span style=\"color:#00a\">new<\/span> <span style=\"color:#0aa\">Date<\/span>();\n            d.setTime(d.getTime() + updateSessionCookie.expiresMs);\n            <span style=\"color:#0aa\">document<\/span>.cookie = <span style=\"color:#a50\">'_session_'<\/span> + sendHitTaskModel.get(<span style=\"color:#a50\">'trackingId'<\/span>) + <span style=\"color:#a50\">'=true; expires='<\/span> + d.toUTCString() + <span style=\"color:#a50\">'; path=\/; domain='<\/span> + updateSessionCookie.domain;\n          }\n        }\n        <span style=\"color:#aaa;font-style:italic\">\/\/ \/updateSessionCookie\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>\n      } <span style=\"color:#00a\">catch<\/span>(e) {\n        originalSendHitTask(originalSendHitTaskModel);\n      }\n      \n    });\n  };\n};\n<\/code><\/pre>\n<\/div>\n<p>If you\u2019re using <a href=\"https:\/\/tagmanager.google.com\">Google Tag Manager<\/a>, copy-paste that into a Custom JavaScript variable, and then change the first line to <code>function() {<\/code> and remove the very last character of the code block (the final semicolon). Then, add it as a new <strong>Field to Set<\/strong> in your <a href=\"https:\/\/www.simoahava.com\/analytics\/edit-google-analytics-tag-settings\/\">Google Analytics tag settings<\/a>.<\/p>\n<p>if you\u2019re using Google Analytics, you need to run this JavaScript before the Google Analytics snippet, and then when creating the tracker modify it to:<\/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\">ga(<span style=\"color:#a50\">'create'<\/span>, <span style=\"color:#a50\">'UA-XXXXX-Y'<\/span>);\nga(<span style=\"color:#a50\">'set'<\/span>, <span style=\"color:#a50\">'customTask'<\/span>, _customTask); <span style=\"color:#aaa;font-style:italic\">\/\/ <span style=\"color:#aaa;font-style:italic\"\/>ga(<span style=\"color:#a50\">'send'<\/span>, <span style=\"color:#a50\">'pageview'<\/span>);\n<\/span><\/code><\/pre>\n<\/div>\n<p>This <code>customTask<\/code> should be added to all the tags and hits that you want to have an impact on the session refresh. Basically, it should fire with all your pageviews and events, since those are the two that keep the session alive.<\/p>\n<h2 id=\"how-it-works\">How it works<\/h2>\n<p>Any tag or hit that uses this <code>customTask<\/code> will now run some extra code when the hit has been sent to Google Analytics. The code checks whether the hit was interactive (since non-interactive hits don\u2019t keep a session alive) and whether it was an event or pageview (since those are the two hits that keep a session alive).<\/p>\n<p>In both these conditions are true, a cookie named <code>_session_UA-XXXXX-Y<\/code> is created (or updated if it already exists) with an expiration set to whatever you configured as the value of the <code>expiresMs<\/code> property in the beginning of the code block.<\/p>\n<p>In other words, you will now have a cookie which, if it exists, means there is most likely an active session in Google Analytics. I say \u201cmost likely\u201d, because there are many ways that sessions can be broken off even before the timeout expires.<\/p>\n<p>This cookie is a <strong>reasonable abstraction<\/strong> of the session timeout schema in Google Analytics. It\u2019s not perfect, but it gives you an <em>idea<\/em>.<\/p>\n<h2 id=\"things-you-can-do-with-it\">Things you can do with it<\/h2>\n<p>Well, the easiest thing is to use it to prevent Events from firing if the session cookie doesn\u2019t exist. Why? Because it\u2019s tiresome having sessions that only have events. Even though there\u2019s really no problem with having events fire <strong>before<\/strong> pageviews (even if all the documentation tries to tell you otherwise), there\u2019s a risk you\u2019ll have sessions that <strong>only<\/strong> have events.<\/p>\n<p>Those sessions will be marred with the ugly <code>(not set)<\/code> Landing Page, because Google Analytics is tyrannical in demanding sessions to always include a pageview (I have no idea why).<\/p>\n<p>So, in Google Tag Manager, you could do this by first creating a <strong>1st Party Cookie<\/strong> variable for the session cookie. Remember to change the \u201cUA-XXXXXX-Y\u201d to whatever the tracking ID is for the property whose session timeout you are monitoring.<\/p>\n<div style=\"aspect-ratio: 570 \/ 431;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/08\/session-cookie.jpg\" title=\"Session cookie\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"431\" width=\"570\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/08\/session-cookie.jpg#ZgotmplZ\" alt=\"Session cookie\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Then, create a new Custom Event trigger which checks if this cookie has the value <code>true<\/code>:<\/p>\n<div style=\"aspect-ratio: 866 \/ 379;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/08\/block-session-trigger.jpg\" title=\"Trigger to block if session not alive\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"379\" width=\"866\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/08\/block-session-trigger.jpg#ZgotmplZ\" alt=\"Trigger to block if session not alive\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Now, any tag you add this trigger to as an <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/block-your-tags-with-trigger-exceptions\/\">exception<\/a> will <strong>not<\/strong> fire if the session has timed out.<\/p>\n<p>This is pretty brutal &#8211; you\u2019re not sending event hits to GA because you\u2019re afraid they\u2019ll create orphaned sessions. It\u2019s a valid fear to have with GA\u2019s sessionization schema, but it might be overkill.<\/p>\n<p>So another option is to turn all event hits into <strong>non-interactive<\/strong> hits, because these don\u2019t increment the session counts or dimensions in your data set, but the data is still collected.<\/p>\n<p>To do this, you need a <strong>Custom JavaScript variable<\/strong> that looks like this:<\/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\">return<\/span> {{UA-XXXXX-Y session}} !== <span style=\"color:#a50\">'true'<\/span>;\n}\n<\/code><\/pre>\n<\/div>\n<p>This JavaScript returns <code>false<\/code> if the session is active, and <code>true<\/code> if there is no active session. By adding this to the <strong>Non-Interaction<\/strong> field in your Event tags, the hit will be non-interactive if there is no active session.<\/p>\n<p>You could even modify the <code>customTask<\/code> to do this logic for you. Within the <code>customTask<\/code> method, just after <code>try {<\/code>, you could do something like this (you\u2019ll need the <strong>1st Party Cookie<\/strong> for this):<\/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\">try<\/span> {\n  \n  <span style=\"color:#aaa;font-style:italic\">\/\/ ADD THIS\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">if<\/span> ({{UA-XXXXX-Y session}} !== <span style=\"color:#a50\">'true'<\/span> &amp;&amp; sendHitTaskModel.get(<span style=\"color:#a50\">'hitType'<\/span>) === <span style=\"color:#a50\">'event'<\/span> &amp;&amp; sendHitTaskModel.get(<span style=\"color:#a50\">'nonInteraction'<\/span>) !== <span style=\"color:#00a\">true<\/span>) {\n    <span style=\"color:#00a\">return<\/span>;\n  }\n  <span style=\"color:#aaa;font-style:italic\">\/\/ UP TO HERE\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  \n  originalSendHitTask(sendHitTaskModel);\n  ...\n}\n<\/code><\/pre>\n<\/div>\n<p>This addition prevents the hit from being fired (and the cookie from being created\/updated) if the session is <strong>not<\/strong> alive and the hit is an <strong>interactive event<\/strong>. For all other hit types, the hit gets sent and the cookie gets created. This way you don\u2019t need to mess with triggers &#8211; you can have <code>customTask<\/code> do all the legwork for you.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>This <code>customTask<\/code> trick can be used to bring some insight into the browser whether or not a session is currently active in Google Analytics.<\/p>\n<p>It\u2019s not perfect, since sessionization depends on so many things (of which a multitude happens in the bowel\u2019s of GA\u2019s processing servers), but it can be used as an <em>indication<\/em> of whether or not there\u2019s an active session.<\/p>\n<p>This solution is also <strong>not necessary<\/strong>, especially if you use BigQuery. The raw data you collect from the site is useful and valid even if there\u2019s no pageview initiating a session. So make sure you have a use case for this before taking the plunge.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>In Google Analytics, the concept of a session is the key aggregation unit of all the data you work with. It\u2019s so central to all the key metrics you use (Conversion Rate, Bounce Rate, Session Duration, Landing Page), and yet there\u2019s an underlying complexity that I\u2019m pretty certain is unrecognized by many of GA\u2019s users. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":104135,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[12765,14315,7957,1531,14050,47893,4238],"dealstore":[],"offerexpiration":[],"class_list":["post-104134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-analytics","tag-cookie","tag-create","tag-google","tag-session","tag-timeout","tag-update"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create And Update Google Analytics Session Timeout Cookie - 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=104134\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create And Update Google Analytics Session Timeout Cookie - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"In Google Analytics, the concept of a session is the key aggregation unit of all the data you work with. It\u2019s so central to all the key metrics you use (Conversion Rate, Bounce Rate, Session Duration, Landing Page), and yet there\u2019s an underlying complexity that I\u2019m pretty certain is unrecognized by many of GA\u2019s users. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=104134\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-22T22:14:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"719\" \/>\n\t<meta property=\"og:image:height\" content=\"128\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=104134#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=104134\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Create And Update Google Analytics Session Timeout Cookie\",\"datePublished\":\"2025-02-22T22:14:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=104134\"},\"wordCount\":1022,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=104134#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg\",\"keywords\":[\"Analytics\",\"Cookie\",\"create\",\"Google\",\"session\",\"Timeout\",\"Update\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=104134#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=104134\",\"url\":\"https:\/\/fivemor.com\/?p=104134\",\"name\":\"Create And Update Google Analytics Session Timeout Cookie - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=104134#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=104134#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg\",\"datePublished\":\"2025-02-22T22:14:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=104134#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=104134\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=104134#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg\",\"width\":719,\"height\":128},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=104134#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create And Update Google Analytics Session Timeout Cookie\"}]},{\"@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":"Create And Update Google Analytics Session Timeout Cookie - 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=104134","og_locale":"en_US","og_type":"article","og_title":"Create And Update Google Analytics Session Timeout Cookie - Som2ny Network","og_description":"In Google Analytics, the concept of a session is the key aggregation unit of all the data you work with. It\u2019s so central to all the key metrics you use (Conversion Rate, Bounce Rate, Session Duration, Landing Page), and yet there\u2019s an underlying complexity that I\u2019m pretty certain is unrecognized by many of GA\u2019s users. [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=104134","og_site_name":"Som2ny Network","article_published_time":"2025-02-22T22:14:13+00:00","og_image":[{"width":719,"height":128,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=104134#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=104134"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Create And Update Google Analytics Session Timeout Cookie","datePublished":"2025-02-22T22:14:13+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=104134"},"wordCount":1022,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=104134#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg","keywords":["Analytics","Cookie","create","Google","session","Timeout","Update"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=104134#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=104134","url":"https:\/\/fivemor.com\/?p=104134","name":"Create And Update Google Analytics Session Timeout Cookie - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=104134#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=104134#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg","datePublished":"2025-02-22T22:14:13+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=104134#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=104134"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=104134#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/update-session-cookie.jpg","width":719,"height":128},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=104134#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Create And Update Google Analytics Session Timeout Cookie"}]},{"@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\/104134","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=104134"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/104134\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/104135"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=104134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=104134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=104134"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=104134"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=104134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}