For GA360 clients, the BigQuery export is one of the most powerful features that allow you to work with the raw tracking data. Using this raw, session grouped tracking data on the one hand you might run deeper advanced analysis generating reports that not directly possible in the GA interface. On the other hand you can build your own automated systems to personalize and optimine your website.
Testing a GTM datalayer setup is usually a very time consuming task as you often have to simulate different scenarios and manually check if the datalayer contains the expected values so that everything works correctly. In an optimal case, datalayer tests should also not only be performed before and after a new website is put live but also on minor technical updates or generally from time to time to ensure that the tracking is working correctly.
The following example script asynchronously requests the USD/EUR exchange rate from the Yahoo API in JSON format by using AJAX. As soon as the currency exchange rate data has been received, a GTM Event called "exchangeRate" is fired, sending the currency rate information along as "exchangeRateInfo" parameter in the data layer.
In general there are several possibilities on how to access the Google Tag Manager data layer variables from custom HTML tags. Depending on what exactly you want to achieve, one of methods described in the following section might be more or less suitable.
In many cases it could be interesting to store raw tracking data on hit level besides the pre-processed reports available in the Analytics web interface in order to be able to perform a deeper analysis on this kind of raw data. While Google Analytics Premium offers the feature of Bigquery export, no comparable functionality is available in the free Google Analytics version - at least not out of the box.