title: How do I pass a JS variable to the DataLayer?
body: <p>I am trying to pass a javascript variable to the data layer.</p>
  
  <pre><code>$(document).ready(function() { 
              var dataTag = $('#data-tag-link').attr('data-tag');
              dataTag = "'" + dataTag + "'";
              console.log(dataTag);
  
              dataLayer = [];
              dataLayer.push({
                  'data-tag': dataTag,
                  'data-author': '$Author.xml'
              });
          });
  </code></pre>
  
  <p>The dataLayer is sending the name of the variable however rather than the actual value of the variable, for example it is sending 'dataTag' rather than 'Mobile' which it should be. Any ideas on what this issue could be?</p>