Weather variable is a helpful tool for those who want to monitor the air temperature in their cities effectively and view the data in an analytics tool like Google Analytics 4. With Weather variable, you can set up the tracking via server Google Tag Manager, and in this article, we will guide you through the setup process.
2. Go to your server GTM → click “Templates” → find “Variable Templates” → click “Search Gallery”.
Find the “Weather” variable in the gallery and click “Add to workspace”.
OR
You can manually add it to sGTM. To do this, download the Weather Variable from GitHub. In “Variable Templates,” click “New” → “Import” and choose the variable you recently downloaded.
3. Go to the “Variables” → find the “User-Defined Variables” section → click “New” → choose “Weather” variable type.
4. Configure variable.
4.1 API key - you can get it from the OpenWeather service. The key is free, and you get it one register the account.
4.2 Select unit - here choose between Celcius and Fahrenheit.
4.3 Country code - provide a country and сity to get the temperature. If you use Stape or AppEngine Hosting for sGTM, then country and city will be detected automatically.
4.4 City - specify the city of which you want to monitor the air temperature.
4.5 Logs Settings - choose whether the variable constantly logs to the console, logs during debug mode, or doesn’t log at all.
4.6 (Optional) Format Value - select the options to format the value this variable will output. You have the following options:
Click “Save”.
Find out how to debug and monitor server-side tracking in our blog post. |
To sum up, the Weather variable is a powerful tool for accurately tracking air temperature in your city and analyzing the data using platforms like Google Analytics 4. You can effortlessly incorporate this data into your analytics processes by configuring tracking through server-side Google Tag Manager. We hope you find this setup process of Weather variable easy and straightforward. And if you need help, don’t hesitate to contact us.
We are happy to hear that! Click on Try for free to register and check all the possibilities.