Track weather conditions around the current visitor
Weather tracking is not available from GTM4WP 2.0.0. The feature and all of its data layer variables were removed in that release. This page is kept for the sites that still run a legacy 1.x version and for anyone who needs to know what the variables used to hold.
When you upgrade to 2.0.0 the plugin deletes the stored weather options, including the saved OpenWeatherMap API key. No weather variable is written into the data layer any more, so a Google Tag Manager tag, trigger or variable that reads one of the names below stops receiving a value. Review your container and remove anything that depends on them.
Replacing the feature with server-side Google Tag Manager
The plugin has no built-in replacement. If you run server-side Google Tag Manager, the Weather Variable community template by Stape calls the same OpenWeatherMap API that GTM4WP used and makes the values available in your server container. It returns the temperature, humidity, air pressure, wind speed, visibility or the full API response, and it has a unit system selector, so you can rebuild everything the variables below used to carry.
Two things work differently from the old plugin feature. The template runs in a server container, so it needs a server-side Google Tag Manager setup, and you enter your own OpenWeather API key on the variable, which keeps the key in the container instead of in your WordPress settings. The location normally comes from the city and country code you set on the variable. When the server container runs on Stape or on Google Cloud App Engine, the template reads the geo headers of the incoming request instead and reports the weather around the current visitor, which is the closest equivalent of what the plugin did.
How the feature worked in 1.x
GTM4WP loaded the weather conditions around the visitor from the OpenWeatherMap API and cached the result for one hour to keep the number of API calls down. It relied on the geo data feature to work out where the visitor was, so both had to be set up, each with an API key of its own, and both services could charge for the traffic a busy site generated. The geo data feature was removed in 2.0.0 as well and is described on the geo data page.
Because the IP address of the visitor was shared with those 3rd party services, a block_gtm4wp_geoip cookie set in the browser of the visitor switched the geo and weather lookups off for that person. Any of the values "yes", "true", "on" or "1" counted as a block. That cookie has no effect in 2.0.0, because neither lookup is made any more.
With both API keys set in the plugin options, the following data layer variables were available.
weatherCategory
Legacy 1.x variable. The group of weather parameters: Rain, Snow, Extreme, Clear, and so on.
weatherDescription
Legacy 1.x variable. The exact weather condition within the group, for example Sky is clear.
weatherTemp
Legacy 1.x variable. The current temperature around the visitor, as a float. A radio button in the plugin settings decided whether the number was reported in Celsius or in Fahrenheit.
weatherPressure
Legacy 1.x variable. The current air pressure around the visitor, as an integer.
weatherWindSpeed
Legacy 1.x variable. The current wind speed around the visitor, as a float.
weatherWindDeg
Legacy 1.x variable. The current wind direction around the visitor in degrees, as an integer.
