{"id":24,"date":"2021-04-28T14:25:00","date_gmt":"2021-04-28T18:25:00","guid":{"rendered":"https:\/\/reporting.advally.com\/wordpress\/?post_type=blog&#038;p=24"},"modified":"2025-02-25T14:31:06","modified_gmt":"2025-02-25T19:31:06","slug":"analytics-tagging-for-member-segregation","status":"publish","type":"blog","link":"https:\/\/advally.com\/wordpress\/blog\/analytics-tagging-for-member-segregation\/","title":{"rendered":"Analytics Tagging For Member Segregation"},"content":{"rendered":"\n<p>This guide will help you to view traffic segments of your visitors based on the member type.<\/p>\n\n\n\n<p>The guide assumes you want to track Guests and Members, however you can track any number of visitor types.<br><br><strong>Step 1: Setup Custom Dimensions in Google Analytics<br>Step 2: Pass Custom Dimensions to Google Analytics<br>Implementation &#8211; JavaScript (gTag.js)<br>Implementation &#8211; JavaScript for Universal Analytics (UA) properties:<br>Notes on passing Dimension Value.<br>Step 3: Viewing Results in Google Analytics<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1072\" height=\"852\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/hVLBWIFPTJIt_P8sM0FQU2YWrgY5o9D92JOC1UFHEGoOvTM8irdtlu3c256T6YBZRwwYs5Ol8WhXuC5BkIOY9920TReMGgjMergrKeBVU6lrIEAdILWip-l_Hx2KyBIoabAWGClIAnwmtcDD3ZGnz9Q.png\" alt=\"pasted image 0\" class=\"wp-image-27\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/hVLBWIFPTJIt_P8sM0FQU2YWrgY5o9D92JOC1UFHEGoOvTM8irdtlu3c256T6YBZRwwYs5Ol8WhXuC5BkIOY9920TReMGgjMergrKeBVU6lrIEAdILWip-l_Hx2KyBIoabAWGClIAnwmtcDD3ZGnz9Q.png 1072w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/hVLBWIFPTJIt_P8sM0FQU2YWrgY5o9D92JOC1UFHEGoOvTM8irdtlu3c256T6YBZRwwYs5Ol8WhXuC5BkIOY9920TReMGgjMergrKeBVU6lrIEAdILWip-l_Hx2KyBIoabAWGClIAnwmtcDD3ZGnz9Q-300x238.png 300w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/hVLBWIFPTJIt_P8sM0FQU2YWrgY5o9D92JOC1UFHEGoOvTM8irdtlu3c256T6YBZRwwYs5Ol8WhXuC5BkIOY9920TReMGgjMergrKeBVU6lrIEAdILWip-l_Hx2KyBIoabAWGClIAnwmtcDD3ZGnz9Q-1024x814.png 1024w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/hVLBWIFPTJIt_P8sM0FQU2YWrgY5o9D92JOC1UFHEGoOvTM8irdtlu3c256T6YBZRwwYs5Ol8WhXuC5BkIOY9920TReMGgjMergrKeBVU6lrIEAdILWip-l_Hx2KyBIoabAWGClIAnwmtcDD3ZGnz9Q-768x610.png 768w\" sizes=\"auto, (max-width: 1072px) 100vw, 1072px\" \/><\/figure>\n\n\n\n<p><strong>Step 1: Setup Custom Dimensions in Google Analytics<br><br><\/strong>1. Log into Analytics and open the property where you wish to view Members and Guests.<br>2. Open the \u201cAdmin\u201d panel (link is at the bottom left), then under the Property click \u201cCustom Dimensions\u201d &gt; \u201cCustom Dimensions\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"1024\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-978x1024.png\" alt=\"\" class=\"wp-image-28\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-978x1024.png 978w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-286x300.png 286w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-768x804.png 768w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-1467x1536.png 1467w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image.png 1527w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><br>3.Click \u201c+ NEW CUSTOM DIMENSION\u201d to create a new Dimension. Enter the settings below and click \u201cCreate\u201d<br>\u00a0 \u00a0Name: User Type<br>\u00a0 \u00a0Scope: Hit or Session<br>4.Make note of the \u201cIndex\u201d value for your new dimension.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"254\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-1-1024x254.png\" alt=\"\" class=\"wp-image-29\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-1-1024x254.png 1024w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-1-300x74.png 300w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-1-768x190.png 768w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-1.png 1227w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><br><strong>Step 2: Pass Custom Dimensions to Google Analytics<br><\/strong>The next step is to update the on-page JavaScript to pass the correct value for this dimension. The instructions below presumes the \u201cUser Type\u201d dimension was configured as<strong>\u00a0Dimension Index #1<\/strong>. If other dimensions already exist and a different dimension index was assigned, please update the tags below to reflect the correct Dimension Index.<\/p>\n\n\n\n<p>There are two on-page implementation methods depending on the type of Analytics script used.<\/p>\n\n\n\n<p><br><strong>Implementation &#8211; JavaScript (gTag.js)<br><\/strong>1. Add the Custom Map before gtag(\u2018config\u2019). Make sure to use the correct dimension ID.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>gtag(&#8216;set&#8217;, {&nbsp; &#8216;custom_map&#8217;: { &#8216;dimension<strong>1<\/strong>&#8216;: &#8216;User Type&#8217; }});gtag(&#8216;config&#8217;, &#8216;UA-XXXXXXXX-1&#8217;, &#8230;<\/td><td>\/\/ Insert before gtag(\u201cconfig\u201d)\/\/ Use the correct&nbsp;<strong>dimension ID<\/strong>\/\/ Existing gtag(\u201cconfig\u201d)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>2. Insert one of the following line into the 3rd parameter of gtag(\u2018config\u2019). Set the value to match the current user type:<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Members<\/p>\n\n\n\n<p>gtag(&#8216;config&#8217;, &#8216;UA-XXXXXXXX-1&#8217;, {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&#8216;User Type&#8217;: &#8216;Member&#8217;,<\/p>\n\n\n\n<p>});<\/p>\n\n\n\n<p>\/\/ Visitors<\/p>\n\n\n\n<p>gtag(&#8216;config&#8217;, &#8216;UA-XXXXXXXX-1&#8217;, {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&#8216;User Type&#8217;: &#8216;Visitor&#8217;,<\/p>\n\n\n\n<p>});<\/p>\n\n\n\n<p><br>Here is the full documentation on custom dimensions with gtag():<br><br><a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\/custom-dims-mets\" target=\"_blank\" rel=\"noopener\">https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\/custom-dims-mets<\/a><\/p>\n\n\n\n<p><strong>Implementation &#8211; JavaScript for Universal Analytics (UA) properties:<br><br><br><\/strong>&nbsp;1.Add the Custom Dimension to the UA call. Add the appropriate value based on the user type<\/p>\n\n\n\n<p>\/\/ Visitors<\/p>\n\n\n\n<p>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;,&nbsp;&#8216;Visitor&#8217;);<\/p>\n\n\n\n<p>\/\/ Members<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ga(&#8216;set&#8217;, &#8216;dimension1&#8217;,&nbsp;&#8216;Member&#8217;);<\/p>\n\n\n\n<p><br><strong>Notes on passing Dimension Value.<br><\/strong>&nbsp;You can pass the dimension value in several ways depending on your CMS. It can be done entirely through JavaScript by checking for a value or element on the page that may indicate the user type. Or it can be done server-side.<br><br>Server-Side example with XenForo1 Template:<br><br>&lt;xen:if is=&#8221;!{$visitor.user_id}&#8221;&gt;<br>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;, &#8216;Visitor&#8217;);<br>&lt;xen:else \/&gt;<br>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;, &#8216;Member&#8217;);<br>&lt;\/xen:if&gt;<br><br>Server-Side example with XenForo2 Template:<br><br>&lt;xf:if is=&#8221;!$xf.visitor.user_id&#8221;&gt;<br>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;, &#8216;Visitor&#8217;);<br>&lt;xf:else \/&gt;<br>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;, &#8216;Member&#8217;);<br>&lt;\/xf:if&gt;<br><br>Client-Side example with JavaScript:<br><br>Here is an example of checking if the page has a \u201cLog Out\u201d link, thereby indicating the user is a member. The User type is set depending on the existence of the link.<br><br>if (document.querySelector(&#8216;a#LogOut&#8217;)) {<br>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;, &#8216;Member&#8217;);<br>} else {<br>ga(&#8216;set&#8217;, &#8216;dimension1&#8217;, &#8216;Visitor&#8217;);<br>}<\/p>\n\n\n\n<p><br><strong>Step 3: Viewing results in Google Analytics<br><\/strong>When the above tag changes are complete, results will begin to appear after 24 hours. You can view them in Analytics by creating a custom Segment.<br><br>1. Open the Audience Overview, or really any report under Audience, Acquisition or Behavior<br>2. At the top of the report click \u201c+ Add Segment\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1434\" height=\"993\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/vqFVpDyw3Svxeg7SaDyWOeYiWQVBcX6Jv3kKNipn6SG12DCs5lncwB7ePqNA7Ur9Ojfo0A0k6dIodBHrR6ZukxcadLMvRkgrUrks3sReWgjVLijjf5ZwAMDIftmvLzPOiKDM9YCWiUDsZeo-7-DC2kQ.png\" alt=\"screencapture-analytics-google-analytics-web-2021-02-25-14_06_00-edit\" class=\"wp-image-26\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/vqFVpDyw3Svxeg7SaDyWOeYiWQVBcX6Jv3kKNipn6SG12DCs5lncwB7ePqNA7Ur9Ojfo0A0k6dIodBHrR6ZukxcadLMvRkgrUrks3sReWgjVLijjf5ZwAMDIftmvLzPOiKDM9YCWiUDsZeo-7-DC2kQ.png 1434w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/vqFVpDyw3Svxeg7SaDyWOeYiWQVBcX6Jv3kKNipn6SG12DCs5lncwB7ePqNA7Ur9Ojfo0A0k6dIodBHrR6ZukxcadLMvRkgrUrks3sReWgjVLijjf5ZwAMDIftmvLzPOiKDM9YCWiUDsZeo-7-DC2kQ-300x208.png 300w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/vqFVpDyw3Svxeg7SaDyWOeYiWQVBcX6Jv3kKNipn6SG12DCs5lncwB7ePqNA7Ur9Ojfo0A0k6dIodBHrR6ZukxcadLMvRkgrUrks3sReWgjVLijjf5ZwAMDIftmvLzPOiKDM9YCWiUDsZeo-7-DC2kQ-1024x709.png 1024w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/vqFVpDyw3Svxeg7SaDyWOeYiWQVBcX6Jv3kKNipn6SG12DCs5lncwB7ePqNA7Ur9Ojfo0A0k6dIodBHrR6ZukxcadLMvRkgrUrks3sReWgjVLijjf5ZwAMDIftmvLzPOiKDM9YCWiUDsZeo-7-DC2kQ-768x532.png 768w\" sizes=\"auto, (max-width: 1434px) 100vw, 1434px\" \/><\/figure>\n\n\n\n<p>3. Click \u201cNew Segment<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"304\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-2-1024x304.png\" alt=\"\" class=\"wp-image-31\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-2-1024x304.png 1024w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-2-300x89.png 300w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-2-768x228.png 768w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-2.png 1237w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><br>4. Enter a Name for the segment, like \u201cUser Type: Members\u201d and add a condition on the Custom Dimension \u201cUser Type\u201d is exactly equal to \u201cMember\u201d. Click the blue \u201cSave\u201d button to add the new segment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-3-1024x559.png\" alt=\"\" class=\"wp-image-32\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-3-1024x559.png 1024w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-3-300x164.png 300w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-3-768x419.png 768w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2021\/04\/image-3.png 1422w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><br>5. Repeat step 5 but for User Type: Visitor<\/p>\n\n\n\n<p><br>6. You can now select this segment to view the analytics for this segment as it relates to overall traffic.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1072\" height=\"852\" src=\"https:\/\/reporting.advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/jYGYbDcpHUE-olrlkH1wBfRIheBcySNksKMK5uQWpyzk6km71ROO320wWzoSKKEDmd1qq9_ucs9NtRYPhQ1CQD37gghSW5vFSarInSztg9r0UbhggC3diGXODu24Lk1XRoXNYdchSfDJ48JKuR7h5G4.png\" alt=\"pasted image 0-1\" class=\"wp-image-25\" title=\"\" srcset=\"https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/jYGYbDcpHUE-olrlkH1wBfRIheBcySNksKMK5uQWpyzk6km71ROO320wWzoSKKEDmd1qq9_ucs9NtRYPhQ1CQD37gghSW5vFSarInSztg9r0UbhggC3diGXODu24Lk1XRoXNYdchSfDJ48JKuR7h5G4.png 1072w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/jYGYbDcpHUE-olrlkH1wBfRIheBcySNksKMK5uQWpyzk6km71ROO320wWzoSKKEDmd1qq9_ucs9NtRYPhQ1CQD37gghSW5vFSarInSztg9r0UbhggC3diGXODu24Lk1XRoXNYdchSfDJ48JKuR7h5G4-300x238.png 300w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/jYGYbDcpHUE-olrlkH1wBfRIheBcySNksKMK5uQWpyzk6km71ROO320wWzoSKKEDmd1qq9_ucs9NtRYPhQ1CQD37gghSW5vFSarInSztg9r0UbhggC3diGXODu24Lk1XRoXNYdchSfDJ48JKuR7h5G4-1024x814.png 1024w, https:\/\/advally.com\/wordpress\/wp-content\/uploads\/2025\/02\/jYGYbDcpHUE-olrlkH1wBfRIheBcySNksKMK5uQWpyzk6km71ROO320wWzoSKKEDmd1qq9_ucs9NtRYPhQ1CQD37gghSW5vFSarInSztg9r0UbhggC3diGXODu24Lk1XRoXNYdchSfDJ48JKuR7h5G4-768x610.png 768w\" sizes=\"auto, (max-width: 1072px) 100vw, 1072px\" \/><\/figure>\n\n\n\n<p>We understand this can be a daunting task, if you require assistance, please do not hesitate to contact us at help@advally.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide will help you to view traffic segments of your visitors based on the member type.<\/p>\n","protected":false},"author":1,"featured_media":0,"template":"","tags":[],"class_list":["post-24","blog","type-blog","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/blog\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/blog\/24\/revisions"}],"wp:attachment":[{"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/advally.com\/wordpress\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}