title: How can we set analytics.js cookies after user confirmation?
body: <p>With GDPR coming into force, we wanted to restrict our application from dropping any cookie until the user confirms his/her consent.</p>
  
  <p>To do this, I have disabled the analytics on page load by using the following config.</p>
  
  <pre><code>window['ga-disable-UA-XXXXXXXX-X'] = true;
  </code></pre>
  
  <p>After user gives consent by clicking on the cookie banner, I have to enable tracking. </p>
  
  <p>Theoretically, I have to enable it by adding the below line after user action.</p>
  
  <pre><code>window['ga-disable-UA-XXXXXXXX-X'] = false;
  </code></pre>
  
  <p>and run the analytics.js again which i am not sure how to.</p>
  
  <p>I have found a solution for the legacy ga.js but not for analytics.js.</p>
  
  <p>Is there any other way of doing this which i am missing?</p>
  
  <p>Any pointers would be appreciated.</p>