title: How to use localStorage to store user id
body: <p>I want to use localStorage to store user id. Then fetch the user id if it exists and if it does not exist then create it using the google's analytics.js and store it.</p>
  
  <p>To get clientId I am using the following code:-</p>
  
  <pre><code>ga('create', 'UA-XXXXX-Y', 'auto');
  ga(function(tracker) {
    var clientId = tracker.get('clientId');
    console.log(tracker.get('clientId'));
  });
  </code></pre>
  
  <p>The clientId generated here should be stored as an user id.</p>