Variables Is there a global variable that prints out on the page you want to build the rules around? That's the purpose of this. To give you a real life example: On mine, I noticed that, by default, tags are printed in global variables on the page (like blog post tags, not marketing tags). Take this article for example. In , we see that the label is passed into (god knows why they chose to call this variable keyboard. Misspelling.
Creating a macro for this allows me to set custom rules that the C Level Contact List label triggers based on the data in the macro. It's very easy to write a rule to trigger a custom version of a custom variable when it is detected. Note that I referenced the macro I just created above using syntax in the custom variable line. Custom Variable Tags Managing the Data Layer Completely explaining the data layer brings a whole can of worms. If you want to know the full story, it's described in detail in this article.
The data layer is a collection of data on a page that contains any important information from that page in an easily accessible format. Imagine a confirmation page on an e-commerce website: you have transaction details, shipping details, quantity, product, order number, etc. This information is scattered across the page. The data layer stores all information in name-value pairs in the source code (not printed on the page so the user can see it), making access to the tag manager very simple.