0

I have setup a Data Layer Variable type macro named orderTotal which is linked to a variable I am pushing through on the checkout page.

In my custom HTML tag I am doing following:

var order_tot = {{orderTotal}};

But the issue is that when I test and look at the page source via browser I am getting following instead of actual data:

order_tot=google_tag_manager["GTM-[container id]"].macro(2)

Same thing is happening with another macro of similar type.

Can someone please help?

Abhishek Asthana
  • 1,857
  • 1
  • 31
  • 51
failsafe
  • 15
  • 6

1 Answers1

4

Actually that probably means it's working. GTM packs all your tags javascript functions that are injected into your page. Having a string literal like "{{macro}}" in there would be no good, so GTM replaces this with a call to a method that retrieves the intended value (case in point, GTM does the same with my macros and they work beautifully).

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62