User Weather in the Data Layer

Our custom Listeners make it easy to generate data layers from user activity and characteristics on your website or application. Check out samples of data layer activity from our User Weather Listener - the easiest way to get local weather information from your website or application users.

Users' Weather Data Layer Examples

Learn more about how ListenLayer generates powerful data layers from the activity on your website, specifically based on visitors’ local weather.

Custom Data Layer Events

The User Weather Listener automatically generates data layer events, including the visitor’s local weather information, when they begin a session on your website or application. Use these as triggers to identify when information is available and collect that data and your other analytics using Google Tag Manager.

event: 'currentWeather'

event: 'recentWeather'

event: 'forecastWeather'

Automatic Data Layer Values

All Weather events in the data layer are paired with a set of automatic variables containing characteristics of the user’s local weather.

Detailed weather information includes:

  • A general weather description
  • Humidity, Pressure, Cloudiness, Visibility, and Windspeed
  • Temperature in Fahrenheit and Celsius
  • Max, Min, and Current or average Temperatures (including “feels like”)
  • Precipitation amounts broken out by rain, snow, and total
  • Sunrise, sunset, and daylight times
  • The local weather time presented in multiple timestamp formats
  • The website location where the user was at when the weather was pulled
  weatherAutomaticValues: {
    current: {
      weatherDescription: {summary: "Clouds", details: "broken clouds"},
      otherWeather: {
        humidity: 0.39,
        cloudiness: 0.6,
        visibility: 10000,
        windSpeedMPH: 19,
        windSpeedKPH: 30,
        pressure: 996
      },
      fahrenheit: {
        currentTemp: 46,
        feelsLikeTemp: 39,
        currentTempRange: "Chilly (39 - 49)",
        maxTemp: 47,
        minTemp: 44
      },
      celsius: {
        currentTemp: 7.5,
        feelsLikeTemp: 3.5,
        currentTempRange: "Chilly (4 - 9.5)",
        maxTemp: 8.5,
        minTemp: 7
      },
      precipitation: {
        rain: {last1Hour: 0, last3Hours: 0},
        snow: {last1Hour: 0, last3Hours: 0},
        totalLast1Hour: 0,
        totalLast3Hours: 0
      },
      daylight: {sunrise: 1640699149, sunset: 1640733597, daylightTime: 34448},
      weatherTime: {
        unix: 1640700553,
        ISO: "2021-12-28 14:09:13 UTC",
        utcTimeZoneOffset: -21600,
        timezone: "UTC-06:00(America/Chicago)"
      }
    },
    weatherLocation: {
      url: "https://demo.hostedstaging.com/?gtm_debug=1640700621209",
      tld: "hostedstaging.com",
      hostname: "demo.hostedstaging.com",
      pathname: "/",
      queryString: "?gtm_debug=1640700621209",
      parameters: {gtm_debug: 1640700621209},
      fragment: null,
      protocol: "https",
      originPathName: "https://demo.hostedstaging.com/"
    }
  },
  weatherCustomValues: {}

Custom Data Layer Values

As ListenLayer generates data layer activity, custom values can be pushed into the data layer based on rules you write inside the platform. This powerful feature allows you to segment, enhance, and enrich your data in limitless ways – no programming required.

weatherCustomValues: {
  //custom values appear here based on rules you write
  weatherType: 'bad'
}
   

Website Visitors' Recent Weather

The Listener allows you to enable recent weather data, going back up to 3 days. Data is organized inside the Automatic Values based on the day relative to the moment when the weather is retrieved. So, for example, if you’re looking for the weather from 3 days ago, the data appears inside of weatherAutomaticValues.recentDays.3DaysAgo. Allowing you to target specific data or capture all the data relative to the user’s sessions, so it is pre-structured for your analytics.

weatherAutomaticValues: {
    recentDays: {
      1DayAgo: {
        weatherDescription: {summary: "Clouds", details: "few clouds"},
        otherWeather: {
          humidity: 0.16,
          cloudiness: 0.2,
          visibility: 10000,
          windSpeedMPH: 1,
          windSpeedKPH: 2,
          pressure: 1018
        },
        fahrenheit: {
          avgTemp: 57,
          avgFeelsLikeTemp: 53,
          avgTempRange: "Mild (50 - 65)",
          maxTemp: 57,
          minTemp: 31
        },
        celsius: {
          avgTemp: 14,
          avgFeelsLikeTemp: 12,
          avgTempRange: "Mild (10 - 18.5)",
          maxTemp: 14,
          minTemp: -1
        },
        precipitation: {snow: 0, rain: 0, total: 0},
        daylight: {sunrise: 1640009751, sunset: 1640043506, daylightTime: 33755},
        weatherDate: {
          unix: 1640034022,
          ISO: "2021-12-20 21:00:22 UTC",
          utcTimeZoneOffset: -25200,
          timezone: "UTC-07:00(America/Denver)",
          Date: "2021-12-20",
          relativeToCurrent: -1,
          relativeToCurrentDescription: "1 Day Ago"
        }
      },
      2DaysAgo: {
        weatherDescription: {summary: "Clouds", details: "few clouds"},
        otherWeather: {
          humidity: 0.13,
          cloudiness: 0.2,
          visibility: 10000,
          windSpeedMPH: 3,
          windSpeedKPH: 5,
          pressure: 1015
        },
        fahrenheit: {
          avgTemp: 57,
          avgFeelsLikeTemp: 53,
          avgTempRange: "Mild (50 - 65)",
          maxTemp: 57,
          minTemp: 27
        },
        celsius: {
          avgTemp: 14,
          avgFeelsLikeTemp: 11.5,
          avgTempRange: "Mild (10 - 18.5)",
          maxTemp: 14,
          minTemp: -2.5
        },
        precipitation: {snow: 0, rain: 0, total: 0},
        daylight: {sunrise: 1639923319, sunset: 1639957081, daylightTime: 33762},
        weatherDate: {
          unix: 1639947622,
          ISO: "2021-12-19 21:00:22 UTC",
          utcTimeZoneOffset: -25200,
          timezone: "UTC-07:00(America/Denver)",
          Date: "2021-12-19",
          relativeToCurrent: -2,
          relativeToCurrentDescription: "2 Days Ago"
        }
      },
      3DaysAgo: {
        weatherDescription: {summary: "Clear", details: "clear sky"},
        otherWeather: {
          humidity: 0.1,
          cloudiness: 0.01,
          visibility: 10000,
          windSpeedMPH: 1,
          windSpeedKPH: 2,
          pressure: 1021
        },
        fahrenheit: {
          avgTemp: 44,
          avgFeelsLikeTemp: 44,
          avgTempRange: "Chilly (39 - 49)",
          maxTemp: 44,
          minTemp: 9
        },
        celsius: {
          avgTemp: 7,
          avgFeelsLikeTemp: 7,
          avgTempRange: "Chilly (4 - 9.5)",
          maxTemp: 7,
          minTemp: -13
        },
        precipitation: {snow: 0, rain: 0, total: 0},
        daylight: {sunrise: 1639836885, sunset: 1639870657, daylightTime: 33772},
        weatherDate: {
          unix: 1639861222,
          ISO: "2021-12-18 21:00:22 UTC",
          utcTimeZoneOffset: -25200,
          timezone: "UTC-07:00(America/Denver)",
          Date: "2021-12-18",
          relativeToCurrent: -3,
          relativeToCurrentDescription: "3 Days Ago"
        }
      }
    }

Website Visitors' Weather Forecase

The Listeners also allows you to retrieve the visitor’s forecast weather for up to 3 days into the future. Similar to historical weather, the data are presented relative to the moment when the weather is retrieved. So, for example, if you’re looking to target weather information 3 days from now, you can obtain it using this path: weatherAutomaticValues.forecastDays.next3Days. Allowing you to target specific data or capture all the data relative to the user’s sessions, so it is pre-structured for your analytics.

weatherAutomaticValues: {
    forecastDays: {
      next1Day: {
        weatherDescription: {summary: "Clouds", details: "broken clouds"},
        otherWeather: {
          humidity: 0.16,
          cloudiness: 0.61,
          visibility: "",
          windSpeedMPH: 10,
          windSpeedKPH: 17,
          pressure: 1011
        },
        fahrenheit: {
          avgTemp: 48,
          avgFeelsLikeTemp: 45,
          avgTempRange: "Chilly (39 - 49)",
          maxTemp: 53,
          minTemp: 32
        },
        celsius: {
          avgTemp: 9,
          avgFeelsLikeTemp: 7,
          avgTempRange: "Chilly (4 - 9.5)",
          maxTemp: 11.5,
          minTemp: 0
        },
        precipitation: {snow: 0, rain: 0, total: 0},
        daylight: {sunrise: 1640182610, sunset: 1640216363, daylightTime: 33753},
        weatherDate: {
          unix: 1640196000,
          ISO: "2021-12-22 18:00:00 UTC",
          utcTimeZoneOffset: -25200,
          timezone: "UTC-07:00(America/Denver)",
          Date: "2021-12-22",
          relativeToCurrent: 1,
          relativeToCurrentDescription: "Next 1 Day"
        }
      },
      next2Days: {
        weatherDescription: {summary: "Clouds", details: "overcast clouds"},
        otherWeather: {
          humidity: 0.28,
          cloudiness: 1,
          visibility: "",
          windSpeedMPH: 14,
          windSpeedKPH: 23,
          pressure: 1008
        },
        fahrenheit: {
          avgTemp: 49,
          avgFeelsLikeTemp: 46,
          avgTempRange: "Chilly (39 - 49)",
          maxTemp: 54,
          minTemp: 35
        },
        celsius: {
          avgTemp: 9.5,
          avgFeelsLikeTemp: 8,
          avgTempRange: "Chilly (4 - 9.5)",
          maxTemp: 12,
          minTemp: 1.5
        },
        precipitation: {snow: 0, rain: 0, total: 0},
        daylight: {sunrise: 1640269036, sunset: 1640302795, daylightTime: 33759},
        weatherDate: {
          unix: 1640282400,
          ISO: "2021-12-23 18:00:00 UTC",
          utcTimeZoneOffset: -25200,
          timezone: "UTC-07:00(America/Denver)",
          Date: "2021-12-23",
          relativeToCurrent: 2,
          relativeToCurrentDescription: "Next 2 Days"
        }
      },
      next3Days: {
        weatherDescription: {summary: "Clear", details: "sky is clear"},
        otherWeather: {
          humidity: 0.33,
          cloudiness: 0.01,
          visibility: "",
          windSpeedMPH: 18,
          windSpeedKPH: 29,
          pressure: 996
        },
        fahrenheit: {
          avgTemp: 54,
          avgFeelsLikeTemp: 51,
          avgTempRange: "Mild (50 - 65)",
          maxTemp: 56,
          minTemp: 39
        },
        celsius: {
          avgTemp: 12.5,
          avgFeelsLikeTemp: 10.5,
          avgTempRange: "Mild (10 - 18.5)",
          maxTemp: 13,
          minTemp: 4
        },
        precipitation: {snow: 0, rain: 0, total: 0},
        daylight: {sunrise: 1640355460, sunset: 1640389228, daylightTime: 33768},
        weatherDate: {
          unix: 1640368800,
          ISO: "2021-12-24 18:00:00 UTC",
          utcTimeZoneOffset: -25200,
          timezone: "UTC-07:00(America/Denver)",
          Date: "2021-12-24",
          relativeToCurrent: 3,
          relativeToCurrentDescription: "Next 3 Days"
        }
      }
    }

Website Visitors' Current Weather

The user’s current weather is available with a snapshot of the day’s activity, including min/max temperature and recent precipitation over the previous 1 and 3 hours.

weatherAutomaticValues: {
    weatherDescription: {summary: "Clouds", details: "few clouds"},
    otherWeather: {
      humidity: 0.13,
      cloudiness: 0.22,
      visibility: 10000,
      windSpeedMPH: 5,
      windSpeedKPH: 8,
      pressure: 1014
    },
    fahrenheit: {
      currentTemp: 57,
      feelsLikeTemp: 53,
      currentTempRange: "Mild (50 - 65)",
      maxTemp: 60,
      minTemp: 48
    },
    celsius: {
      currentTemp: 14,
      feelsLikeTemp: 11.5,
      currentTempRange: "Mild (10 - 18.5)",
      maxTemp: 15.5,
      minTemp: 8.5
    },
    precipitation: {
      rain: {last1Hour: 0, last3Hours: 0},
      snow: {last1Hour: 0, last3Hours: 0},
      totalLast1Hour: 0,
      totalLast3Hours: 0
    },
    daylight: {sunrise: 1640096181, sunset: 1640129934, daylightTime: 33753},
    weatherTime: {
      unix: 1640120422,
      ISO: "2021-12-21 21:00:22 UTC",
      utcTimeZoneOffset: -25200,
      timezone: "UTC-07:00(America/Denver)"
    },
    weatherLocation: {
      url: "https://demo.hostedstaging.com/?gtm_debug=1640120420011",
      tld: "hostedstaging.com",
      hostname: "demo.hostedstaging.com",
      pathname: "/",
      queryString: "?gtm_debug=1640120420011",
      parameters: {gtm_debug: 1640120420011},
      fragment: null,
      protocol: "https",
      originPathName: "https://demo.hostedstaging.com/"
    }
  }