title: Using Google Optimize without visual editor?
body: <p>We are trying to create A/B testing framework for our site.
  We have decided to use google optimize tool. but we don't need the their built in visual editor, only use the their experiment management (variants percentage, Objective, Targeting, Reporting) and to make all the changes in our javascript code (written with AngularJS framework).</p>
  
  <p>So from my research so far i've seen this:</p>
  
  <pre><code>function gtag() {dataLayer.push(arguments)}
  
  function implementExperimentA(value) {
    if (value ==  '0') {
      // Provide code for visitors in the original.
    } else if (value == '1') {
      // Provide code for visitors in first variant.
    } else if (value == '2') {
      // Provide code for visitors in section variant.
    }
    ...
  }
  
  gtag('event', 'optimize.callback', {
      name: '&lt;experiment_id_A&gt;',
      callback: implementExperimentA
   });
  </code></pre>
  
  <p>and I use this way for getting the variant</p>
  
  <pre><code>google_optimize &amp;&amp;  google_optimize.get('&lt;experiment_id_A&gt;');
  
  for example 
  var variantId = google_optimize.get('someTest');
  
  if (variantId == '0'){
     // blue button
  }
  else if (variantId == '1'){
     // red button
  }
  </code></pre>
  
  <p>what is the proper way to do what i'm looking for.
  and should i use google optimize for this purpose? (AB testing only in code without editor)</p>