{"id":149510,"date":"2025-03-22T10:16:33","date_gmt":"2025-03-22T10:16:33","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/gtmtips-track-url-fragments-as-pageviews\/"},"modified":"2025-03-22T10:16:33","modified_gmt":"2025-03-22T10:16:33","slug":"gtmtips-track-url-fragments-as-pageviews","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=149510","title":{"rendered":"#GTMtips: Track URL Fragments As Pageviews"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>(<strong>Updated  15 July 2015<\/strong>: Added a huge simplification. Jump straight to the update at the end.)<\/p>\n<p>URL fragments are strings of characters that follow a <strong>hash mark<\/strong> (#) in the URL. Typically, they are used for anchor links, where following a link keeps you on the same page but jumps the browser to some anchored position. They\u2019re also the tool of choice for single-page apps, where content is served dynamically without page reloads.<\/p>\n<p>In <a href=\"https:\/\/analytics.google.com\">Google Analytics<\/a>, fragment changes are not tracked by default, and the URL paths that are passed to GA with your Pageview hits are stripped of these fragments. With <a href=\"https:\/\/tagmanager.google.com\">Google Tag Manager<\/a>, this can be remedied with a <strong>History Change Trigger<\/strong> and some Variable magic.<\/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=\"tip-18-track-url-fragments-as-pageviews\">Tip 18: Track URL fragments as Pageviews<\/h2>\n<div style=\"aspect-ratio: 1519 \/ 848;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/03\/url-fragments-as-pageviews.jpg\" title=\"Track URL Fragments As Page Views\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"848\" width=\"1519\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/03\/url-fragments-as-pageviews.jpg#ZgotmplZ\" alt=\"Track URL Fragments As Page Views\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>When the URL fragment of the page changes, it doesn\u2019t cause a reload. This is problematic for your Analytics tracking, as you probably have the <strong>All Pages<\/strong> Trigger firing your Page View Tag, and this Trigger only fires once per page load.<\/p>\n<p>However, when the URL fragment of a page changes, what happens <em>behind the scenes<\/em> is interesting: a browser history event is dispatched, and this can be hooked onto. Google Tag Manager provides the perfect way to do it with the <strong>History Change Trigger<\/strong>. It activates when it captures an event dispatched by a the URL fragment change.<\/p>\n<p>So, to track fragment changes, all we need is the History Trigger and some Variables, so that we can get a nice, lean, flexible setup running.<\/p>\n<h3 id=\"1-the-variables\">1. The Variables<\/h3>\n<p>First, head on over to the <strong>Variables<\/strong> section of Google Tag Manager, and make sure you\u2019ve checked the <strong>New History Fragment<\/strong> and <strong>History Source<\/strong> Built-In Variables.<\/p>\n<div style=\"aspect-ratio: 275 \/ 268;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/03\/built-ins.jpg\" title=\"Built-in history variables\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"268\" width=\"275\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/03\/built-ins.jpg#ZgotmplZ\" alt=\"Built-in history variables\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>New History Fragment stores the new URL fragment when it changes, and History Source will let us specify that we don\u2019t the tag to fire on <em>all<\/em> browser history events; just the one that signals a fragment change.<\/p>\n<p>Next, you\u2019ll need a Custom JavaScript Variable that will produce a new, well-formed URI that we can then send to Google Analytics as the page path of the URL fragment. So, create a new Custom JS Variable, name it <strong>{{get path with fragment}}<\/strong>, and add the following code within:<\/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> {{Event}} === <span style=\"color:#a50\">'gtm.historyChange'<\/span> &amp;&amp; {{New History Fragment}} ? {{Page Path}} + <span style=\"color:#a50\">'#'<\/span> + {{New History Fragment}} : <span style=\"color:#00a\">undefined<\/span>;\n}\n<\/code><\/pre>\n<\/div>\n<p>This simple, one-liner JavaScript function checks first if the Event that invoked this Variable was a history change. If it was and the URL fragment isn\u2019t empty, the next thing it does is return the current page path (e.g. <strong>\/home\/<\/strong>) and concatenates the new URL fragment to the string, separating the two with the \u2018#\u2019 symbol (e.g. <strong>\/home\/#contact-us<\/strong>). If the Event was not a history change, the Variable returns the <em>undefined<\/em> value to ensure that the default path is sent with the Pageview.<\/p>\n<p>The reason we\u2019re sending the Page Path with the \u2018#\u2019 symbol in place is because we want to enable the direct link \u201cVisit this page\u201d functionality in Google Analytics reports. Thanks to <a href=\"https:\/\/plus.google.com\/+StephaneHamel-immeria\/\">St\u00e9phane Hamel<\/a> and <a href=\"https:\/\/plus.google.com\/117298997433687198127\/\">Phil Pearce<\/a> for this tip.<\/p>\n<div style=\"aspect-ratio: 360 \/ 217;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/03\/visit-this-page.jpg\" title=\"Visit this page\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"217\" width=\"360\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/03\/visit-this-page.jpg#ZgotmplZ\" alt=\"Visit this page\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"2-the-trigger\">2. The Trigger<\/h3>\n<p>Create a new Trigger, and name it <strong>Event &#8211; History Fragment Change<\/strong>.<\/p>\n<p>Choose <strong>History Change<\/strong> as the Event, and set the following condition in the <strong>Fire On<\/strong> section of the Trigger:<\/p>\n<p><strong>History Source<\/strong> equals <strong>popstate<\/strong><\/p>\n<div style=\"aspect-ratio: 501 \/ 235;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/03\/history-change-trigger.jpg\" title=\"The History Change Trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"235\" width=\"501\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/03\/history-change-trigger.jpg#ZgotmplZ\" alt=\"The History Change Trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>We\u2019re using <em>popstate<\/em> as a condition, because we don\u2019t want this Trigger to go off on other instances where the History Change Trigger can fire. If you don\u2019t have an AJAX or a single-page site, you wouldn\u2019t have to worry about this, but this is a nice way of delimiting a rather generic Trigger to only fire in relevant situations.<\/p>\n<h3 id=\"3-the-tag\">3. The Tag<\/h3>\n<p>Finally, take your regular Page View Tag, and add the Trigger from (3) to it. This means that the Page View Tag will now have multiple Triggers. Most likely, you\u2019ve used the <strong>All Pages<\/strong> Trigger, so now the Tag will fire both when All Pages matches and when a browser history event is detected.<\/p>\n<p>Next, scroll down to <strong>More Settings -&gt; Fields To Set<\/strong>. Add a new field, name it <strong>page<\/strong>, and set its value to <strong>{{get path with fragment}}<\/strong>.<\/p>\n<div style=\"aspect-ratio: 721 \/ 272;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/03\/page-view-tag-field.jpg\" title=\"Add page to field in tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"272\" width=\"721\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/03\/page-view-tag-field.jpg#ZgotmplZ\" alt=\"Add page to field in tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Save the Tag and start testing.<\/p>\n<h2 id=\"how-it-works\">How it works<\/h2>\n<p>When the page loads, the All Pages Trigger fires your Page View Tag. At this point, GTM will look at the <strong>page<\/strong> field and find the <strong>{{get path with fragment}}<\/strong> Variable there. It proceeds to execute the JavaScript within. However, the one-liner JavaScript only works if the value of the <strong>{{Event}}<\/strong> Variable is <em>gtm.historyChange<\/em>, which is not the case when the All Pages Trigger fires ({{Event}} is <em>gtm.js<\/em> in that case). So, the Variable returns <em>undefined<\/em>, which ensures that the regular Document Path is sent with the Tag instead.<\/p>\n<p>When someone clicks on a link which only has an anchor in the href, such as <code><a href=\"&quot;#contact-us&quot;\">Contact Us<\/a><\/code>, the browser dispatches the history change event, and it\u2019s picked up by the History Change Trigger you created. This causes the Page View Tag to fire again.<\/p>\n<p>This time, as GTM executes the JavaScript code again, the value of <strong>{{Event}}<\/strong> resolves to <em>gtm.historyChange<\/em>, and the Variable returns a string where the URL path of the page, e.g. <strong>\/home\/<\/strong>, is concatenated with the fragment text <strong>#contact-us<\/strong>, resulting in <strong>\/home\/#contact-us<\/strong>.<\/p>\n<h2 id=\"things-to-keep-in-mind\">Things to keep in mind<\/h2>\n<p>If your site is an AJAX or single-page site, there might be other cases where <strong>popstate<\/strong> is dispatched. If this is the situation, you will need to add an additional check into the Custom JavaScript Variable, which compares the Built-In Variables for New History Fragment and Old History Fragment. If they are the same, then it means that the fragment didn\u2019t change and <strong>popstate<\/strong> was dispatched for some other reason. In this case, the Variable needs to return <em>undefined<\/em> as well.<\/p>\n<p>You might want to edit the Custom JavaScript Variable to check for the URL fragment when the page is loaded as well, so that direct visits to a URL fragment will be recorded accordingly in Google Analytics. This would require something like the following:<\/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> ({{Event}} === <span style=\"color:#a50\">'gtm.js'<\/span> || {{Event}} === <span style=\"color:#a50\">'gtm.historyChange'<\/span>) &amp;&amp; {{New History Fragment}} ? {{Page Path}} + <span style=\"color:#a50\">'#'<\/span> + {{New History Fragment}} : <span style=\"color:#00a\">undefined<\/span>;\n}\n<\/code><\/pre>\n<\/div>\n<p>Let me know if you have other issues with this solution. For most use cases, this should work just fine.<\/p>\n<h2 id=\"update\">UPDATE<\/h2>\n<p>The solution above has some problems. First, it doesn\u2019t include a possible <strong>query string<\/strong> in the returned path. Also, if the page is loaded, i.e. there\u2019s no history change, the hash isn\u2019t included in the returned path.<\/p>\n<p>So, a huge simplification is called for. The <strong>{{get path with fragment}}<\/strong> should actually look 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> <span style=\"color:#0aa\">window<\/span>.location.pathname + <span style=\"color:#0aa\">window<\/span>.location.search + <span style=\"color:#0aa\">window<\/span>.location.hash;\n}\n<\/code><\/pre>\n<\/div>\n<p>Then you can just have your Page View Tag fire on both a <strong>Page View<\/strong> Trigger as well as the <strong>History Change<\/strong> Trigger. This Variable, once added to the <strong>page<\/strong> field, will return the path, the query string (if there is one) and the URL hash (if there is one).<\/p>\n<p>Sometimes I think of way too complicated solutions for simple problems \ud83d\ude42<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>(Updated 15 July 2015: Added a huge simplification. Jump straight to the update at the end.) URL fragments are strings of characters that follow a hash mark (#) in the URL. Typically, they are used for anchor links, where following a link keeps you on the same page but jumps the browser to some anchored [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":149511,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[62556,14492,62557,1018,19135],"dealstore":[],"offerexpiration":[],"class_list":["post-149510","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-fragments","tag-gtmtips","tag-pageviews","tag-track","tag-url"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#GTMtips: Track URL Fragments As Pageviews - 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=149510\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#GTMtips: Track URL Fragments As Pageviews - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"(Updated 15 July 2015: Added a huge simplification. Jump straight to the update at the end.) URL fragments are strings of characters that follow a hash mark (#) in the URL. Typically, they are used for anchor links, where following a link keeps you on the same page but jumps the browser to some anchored [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=149510\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-22T10:16:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1519\" \/>\n\t<meta property=\"og:image:height\" content=\"848\" \/>\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=149510#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=149510\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"#GTMtips: Track URL Fragments As Pageviews\",\"datePublished\":\"2025-03-22T10:16:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=149510\"},\"wordCount\":1168,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=149510#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg\",\"keywords\":[\"Fragments\",\"GTMTips\",\"Pageviews\",\"Track\",\"url\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=149510#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=149510\",\"url\":\"https:\/\/fivemor.com\/?p=149510\",\"name\":\"#GTMtips: Track URL Fragments As Pageviews - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=149510#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=149510#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg\",\"datePublished\":\"2025-03-22T10:16:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=149510#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=149510\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=149510#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg\",\"width\":1519,\"height\":848},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=149510#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"#GTMtips: Track URL Fragments As Pageviews\"}]},{\"@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":"#GTMtips: Track URL Fragments As Pageviews - 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=149510","og_locale":"en_US","og_type":"article","og_title":"#GTMtips: Track URL Fragments As Pageviews - Som2ny Network","og_description":"(Updated 15 July 2015: Added a huge simplification. Jump straight to the update at the end.) URL fragments are strings of characters that follow a hash mark (#) in the URL. Typically, they are used for anchor links, where following a link keeps you on the same page but jumps the browser to some anchored [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=149510","og_site_name":"Som2ny Network","article_published_time":"2025-03-22T10:16:33+00:00","og_image":[{"width":1519,"height":848,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.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=149510#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=149510"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"#GTMtips: Track URL Fragments As Pageviews","datePublished":"2025-03-22T10:16:33+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=149510"},"wordCount":1168,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=149510#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg","keywords":["Fragments","GTMTips","Pageviews","Track","url"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=149510#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=149510","url":"https:\/\/fivemor.com\/?p=149510","name":"#GTMtips: Track URL Fragments As Pageviews - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=149510#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=149510#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg","datePublished":"2025-03-22T10:16:33+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=149510#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=149510"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=149510#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/url-fragments-as-pageviews.jpg","width":1519,"height":848},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=149510#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"#GTMtips: Track URL Fragments As Pageviews"}]},{"@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\/149510","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=149510"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/149510\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/149511"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149510"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=149510"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=149510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}