Since the last few weeks I have been having problems with the data layer variables.
Variables like postCategory or visitorType appear “undefined” when the “all pages” trigger is fired.
The tags that are activated on all pages are executed before the data layer loads the variables, so all the parameters end up undefined.
This did not happen before, I have declared all my data layer variables correctly, but it seems that now they are out of time, the tags are executed before the variable values have been loaded.
Any idea what could be happening?
Thanks
EDIT:
I’ve added a new “DOM Ready” trigger that fixes the issue of undefined variables. This solves my problem.
Even so, this did not happen before.