0

Passing user's timezone information to downstream services

Hi all,

For some of our users we happen to know which timezone our users are in. We store this information in our database, in the traditional tzdata format. For example: 

America/Los_Angeles

We have certain downstream services (e.g. email automation using Vero).  We would like to be able to pass our user's preferred timezone so that these downstream services can use it. We are triggering identify and track calls from our server-side implementation.  I know Segment's JS library is tracking timezone, which seems to similarly be passing around tzdata.  I noticed it on this:
https://segment.com/docs/spec/common/

Questions:

1. From server-side, how are we supposed to pass timezone?  

     A. Can we pass timezone key with an identify call?  Similarly, does it live within the context key? For example:

{
    "userId": 123,
    "traits": {...},
    "context": {
        "timezone": "America/Los_Angeles"
    }
}

    B. If not, do we need to pass the user's timezone for every single track call?  Similarly, does it live within the context key? For example:

{
  "userId": 123,
  "event": "Event Name",
  "properties": {...},
  "context": {
      "timezone": "America/Los_Angeles"
  }
}

2. We really only want to be passing the user's timezone as additional context about the user, but is there any concerns we should be aware of (at least from Segment's point of view) if we set the timezone from server side?  

 

Thanks in advance,

Jesse

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Jesse Forrest - thanks for reaching out! The timezone will be automatically picked up for certain libraries (as detailed here); in all other cases the timezone will default to UTC. As you are sending data server-side you can manually set the timezone in any call so long as you comply with the common spec structure; however we generally recommend that you instead change the timezone inside the destination tool you are using as they typically have a way to let you set that with their UI. Hope this info helps!
    Cheers,
    James

    Reply Upvote