title: Why is my user scoped custom dimension changing on past hits?
body: <p>Is a user scoped custom dimensions supposed to change for past hits? For example, I have a custom dimension for PromoCode which tracks the promo code that a user came to the site with (ie: through an ad/offer). I have the dimension set up in Tag Manager like so: </p>
  
  <p>Google Analytics Pageview Tag (custom dimensions section):</p>
  
  <pre><code>Index    Dimension Value
  2        {{ValidPromoCode}}
  </code></pre>
  
  <p>Variables: <code>{{varPromoCode}}</code></p>
  
  <pre><code>Type: URL
  Component Type: Query
  Query Key: promocode
  </code></pre>
  
  <p>Then I have some javascript in the actual site to grab the promocode and set it as a cookie which is checked in the <code>{{ValidPromoCode}}</code> var - so it checks for a promocode in the URL, if it's there it changes the dimension value to that, otherwise it uses the cookie value:</p>
  
  <pre><code>function() {
      //parse promocode value from cookie string
      var promoCode = document.cookie.substring( document.cookie.indexOf("promocode=") + 10, document.cookie.indexOf( ";", document.cookie.indexOf("promocode=") + 10 ) );
      if( typeof {{varPromoCode}} == "undefined" ) {
          if ( document.cookie.indexOf("promocode") &gt;= 0 ) {
              return promoCode;
          } else {
              return null;
          }
      } else {
          //docs say a query var will return the full querystring if the parameter
          //is not found, from my experience it returns undefined. 
          //simple check for querystring here anyway (if it has = its a querystring)
          if ( {{varPromoCode}}.indexOf("=") == -1 ) {
              return {{varPromoCode}};
          } else {
              return null;
          }
      }
  }
  </code></pre>
  
  <p>This is all working as expected. Using tag manager debug and google analytics debugger the proper values are set in all scenarios when the hits are sent. (ie: changing the promocode, deleting the cookie, no promocode etc). </p>
  
  <p>The problem is (and maybe it's not a problem, but a feature)... When I use one promocode, say <code>TEST16</code> then I do some pageviews, trigger some events then go check in analytics a few minutes later, there are my pageviews/events with the <code>TEST16</code> promocode attached... However, if I then change the promocode to say <code>T35T16</code> and go do some different pageviews/events... Then check analytics a few minutes later the first code <code>TEST16</code> is nowhere in sight and the pages/events I hit now show the <code>T35T16</code> promocode... </p>
  
  <p>Is this how user scope is supposed to work? I thought no analytics data/changes ever propagated backwards in time? </p>
  
  <p>I want the promocode to follow the user indefinitely, but I also want it to change if I change the value (ie: they clicked a new ad) without affecting their past hits/promo values.</p>
  
  <p>Should I be using session scope? Or should I change my implementation somehow? </p>