title: Inserting GTM variable instead of HTML object
body: <p>I'm trying to implement a marketing tag on a website where the value needed on the tag should come from an HTML object, although when trying to replace this with a GTM variable, no data is transferred into the tag.</p>
  
  <p>These are the instructions from their documentation:</p>
  
  <blockquote>
    <p>For Google Tag Manager (GTM) integration, create a HTML-object (jQuery
    is required) containing  and replace all variables with their real
    DATA values (cf. next section).</p>
  </blockquote>
  
  <p><strong><code>HTML-Object at your checkout page</code></strong></p>
  
  <pre><code>&lt;div id='transactionString' data-transaction-string='DATA'&gt;&lt;/div&gt;
  </code></pre>
  
  <blockquote>
    <p>Create a custom HTML-Tag in GTM with the following code snippet and
    pass the data from the new HTML object. Finally, you can add your
    checkout page to the trigger rules of GTM.</p>
  </blockquote>
  
  <p><strong><code>Create custom HTML tag in GTM</code></strong></p>
  
  <pre><code>&lt;script src="https://tracking.crealytics.com/lib/multi_conversion.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt; var transactionString =  
  $("#transactionString").data("transaction-string");
  __multi_conversion_tracking(70, "transactionString"); 
  &lt;/script&gt; &lt;noscript&gt; &lt;div style="display:inline;"&gt; 
  &lt;img&gt; src="https://tracking.crealytics.com/70/multi_check.php?data=transactionString"&gt;
  &lt;/div&gt; &lt;/noscript&gt;
  </code></pre>
  
  <p>Everything is ready in the dataLayer, the formatting and the values are all correct, but the only problem is when I pass these values into the variable of GTM.</p>
  
  <p>This is the custom HTML tag I set in GTM:</p>
  
  
  
  <pre><code>&lt;script type="text/javascript"&gt; var transactionString =  
  $({{VariableInGTM}}).data("transaction-string");
  __multi_conversion_tracking(70, "transactionString"); 
  &lt;/script&gt; &lt;noscript&gt; &lt;div style="display:inline;"&gt; 
  &lt;img&gt; src="https://tracking.crealytics.com/70/multi_check.php?data=transactionString"&gt;
  &lt;/div&gt; &lt;/noscript&gt;
  </code></pre>
  
  <p>So in short, I replaced </p>
  
  <blockquote>
    <p>"#transactionString"</p>
  </blockquote>
  
  <p>for </p>
  
  <blockquote>
    <p>{{VariableInGTM}}</p>
  </blockquote>
  
  <p>EDIT:</p>
  
  <pre><code> var divElement = document.createElement("Div");  
   divElement.id = "transactionString"; 
   divElement.setAttribute('data-transaction-string', products_info);
  </code></pre>