title: view_item Event variable data return "undefined"
body: <p>I created trigger to fire when the view_item event occurs by using a custom event and setting the &quot;Event&quot; equals &quot;view_item&quot;.  in preview mode when I check the view_item event, the built-in dataLayer.push is showing the item name.  I created a variable that will pull the dataLayer information from the &quot;name&quot; key.  When I inspect the &quot;view_item&quot; event, the variable I created shows up with the correct value of the item name.  However, in my tag, the <code>{{Item Name}}</code> variable is showing up as undefined.  I've tried to look for Google documentation on the hierarchy of the &quot;view_item&quot; event and the firing of the tags, but I couldn't find anything explicit.</p>
  <p>Why is my &quot;Custom HTML&quot; tag that uses my <code>{{Item Name}}</code> variable showing as &quot;undefined&quot; when the &quot;Variables&quot; section for this partcular event shows the proper value?</p>
  <p>Here is my custom html tag:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  voyage.event(6157, { productName: '{{Item Name}}', productViewed: '{{Page URL}}' })
  &lt;/script&gt;
  </code></pre>
  <p>The <code>{{Page URL}}</code> built in variable is showing properly.  I know it's loaded when the container loads.  But the <code>{{Item Name}}</code> variable is not showing.  It (the data.push()) is pushing the correct data on the view_item event, but why is my variable not displaying the data correctly.</p>
  <p>If this is a hierarchy issue, how do I make sure that I fire this tag after the view_item event happens.</p>
  <p>Also, what puzzles me is that I also have a GA4 tag that is triggered by the same &quot;view_item&quot; event and the parameters I set for this event also use the <code>{{Item Name}}</code> variable and the value is showing up correctly in this tag.</p>
  <p>Furthermore, subsequent events such as DOM Ready or Window Loaded do not show that my user defined &quot;Item Name&quot; variable contains a value.  I was under the impressions that data.push() on the view_item event was adding to the data layer, but it would appear not.  It seems that my user defined variable is only good on the view_item event.</p>
  <p>And finally, although the Google Tag Manager preview window shows that my data layer on the final Window Loaded event only contains the below data, when I use javascript to access window.dataLayer my data is all there.</p>
  <pre><code>{
    event: &quot;gtm.load&quot;,
    gtm: {uniqueEventId: 10, start: 1644552712402},
    developer_id: {dOGY3NW: true}
  }
  </code></pre>
  <p>I'm extremely confused, as I thought the data layer was reset on each page load, but it would seem that the data layer object (according to the preview mode) is being reset on each event, or the data.push() items are not persistent till the final Window Loaded event.  BUT, the actual javascript object IS being added to.</p>
  <p><a href="https://i.stack.imgur.com/t2he5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t2he5.png" alt="Variables" /></a></p>
  <p><a href="https://i.stack.imgur.com/1QtVk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1QtVk.png" alt="Undefined" /></a></p>