Comments (9)
Hey, thanks for making this issue.
What version of the lib are you using? I'm pretty sure I fixed this issue in 2.0.2: aebd744. Can you upgrade to the latest version and let me know if that works for you?
from analytics-ruby.
So I upgrade to 2.0.3 and it fixed most of the issues however I've noticed some of my unresolved problems are because group
doesn't behave just like identify
. I fixed part of that in the pull request above but it seems like there might be a server side fix that needs to happen because Intercom still reports any date I pass it as happening in 1970.
from analytics-ruby.
ok just pushed that pr in 2.0.4.
can you make a comment with code you've got that reproduces the issue? i'm looking at server now and created_at should definitely be working, other dates you're passing into traits may not.
from analytics-ruby.
Okay I think there still are some issues but I'm trying to standardize my tests a bit. The test date/time I'm going to use is Mon, 16 Jun 2014 15:48:33 CDT -05:00
and I've converted it to ActiveSupport::TimeWithZone
, DateTime
, Time
, and Date
.
test_data = User.first.created_at # => Mon, 16 Jun 2014 15:48:33 CDT -05:00
traits = {
time_with_zone: test_data, # => Mon, 16 Jun 2014 15:48:33 CDT -05:00
datetime: test_data.to_datetime, # => Mon, 16 Jun 2014 15:48:33 -0500
time: test_data.to_time, # => 2014-06-16 15:48:33 -0500
date: User.first.created_at.to_date # => Mon, 16 Jun 2014
}
After I've got the data I setup the segment client
client = Segment::Analytics.new({
write_key: ENV['SEGMENT_IO_WRITE_KEY'],
on_error: Proc.new { |status, msg| print msg }
})
Then I finally identify
with Segment
client.identify({
user_id: 1,
context: {},
traits: traits
})
and here is the raw output of the identify
{
"userId": "1",
"anonymousId": null,
"integrations": {},
"traits": {
"time_with_zone": "2014-06-16T15:48:33-05:00",
"datetime": "2014-06-16",
"time": "2014-06-16T15:48:33-05:00",
"date": "2014-06-16"
},
"timestamp": "2014-06-17T21:11:24.000Z",
"type": "identify",
"messageId": "e4ea5aa4-cf2a-439a-9158-e0d090013505",
"writeKey": "bu5sbmslht",
"receivedAt": "2014-06-17T21:11:23.431Z",
"requestId": "p578qofv",
"options": {
"library": {
"name": "analytics-ruby",
"version": "2.0.4"
}
}
}
and then I called group
with Segment.
client.group({
user_id: 1,
group_id: 1,
context: {},
traits: traits
})
and here is the raw output of the group
{
"groupId": "1",
"userId": "1",
"traits": {
"time_with_zone": "2014-06-16T15:48:33-05:00",
"datetime": "2014-06-16",
"time": "2014-06-16T15:48:33-05:00",
"date": "2014-06-16"
},
"integrations": {},
"timestamp": "2014-06-17T21:40:18.000Z",
"type": "group",
"messageId": "9eaa9056-93be-42b7-b6cb-94ef3ad1c0ee",
"writeKey": "bu5sbmslht",
"receivedAt": "2014-06-17T21:40:18.334Z",
"requestId": "jfaakm0a",
"options": {
"library": {
"name": "analytics-ruby",
"version": "2.0.4"
}
}
}
This results in the following as of roughly today, 4:18 PM on June 17, 2014 (CDT).
Intercom User:
Intercom Company:
after explicitly setting the fields as dates
Mixpanel:
Class | Intercom User | Intercom Company | Mixpanel |
---|---|---|---|
ActiveSupport::TimeWithZone |
2014-06-16T20:48:33Z |
2014-06-16T20:48:33Z |
2014-06-16T15:48:33 |
DateTime |
2014-06-16T00:00:00Z |
2014-06-16T00:00:00Z |
2014-06-15T19:00:00 |
Time |
2014-06-16T20:48:33Z |
2014-06-16T20:48:33Z |
2014-06-16T15:48:33 |
Date |
2014-06-16T00:00:00Z |
2014-06-16T00:00:00Z |
2014-06-15T19:00:00 |
note: I'm getting the Intercom values from inspecting the source and grabbing the datetime attribute from the time tag
So from my testing here is what I currently see problems with.
DateTime
conversion is broken. It shouldn't be getting converted to a date because it strips off the time.- When you call
group
date fields on the Company in Intercom aren't getting the_at
appended to them. I'm honestly not sure I really want_at
being appended in Identify because the field name might not make sense likestart_date_at
and it's going to create all new fields for the date fields I already have at aren't named that way. However I'd at least like it to be consistent between the two methods so I know what to expect.
from analytics-ruby.
@travisjeffery are you going to open this issue again? I'm still have some problems.
from analytics-ruby.
so what you want is for the sdk to iso-fy each date in traits?
from analytics-ruby.
@travisjeffery I fixed the last issue with the gem.
The other issue is that you are now adding _at
to date fields in Intercom
. While this gets lets Intercom
automatically detect the date correctly it breaks all my old date fields plus the names don't make any senses. I'd much rather just manually change the type in Intercom
and not break my existing date fields. Also this behavior isn't even consistent because group
traits don't get _at
appended to them.
from analytics-ruby.
I just released v2.0.5 with #61. So as far as I know, all the date fixes I can make in the SDK have been made.
The _at
issue is happening server-side and we're discussing the solution now. @calvinfo @ianstormtaylor
from analytics-ruby.
Thanks! I'll check out the changes tomorrow.
from analytics-ruby.
Related Issues (20)
- Introduce sub millisecond timestamps
- Update Travis CI to test supported Ruby versions
- Convert from Travis CI to CircleCI HOT 2
- Enable Logging HOT 1
- at_exit question HOT 1
- Error in documentation HOT 2
- Issues with sending several events at the same moment HOT 1
- anonymous_id HOT 2
- Adding message_id to track call using js2.0 style messageId fails to process HOT 2
- Using `Analytics.flush` to ensure event delivery order? HOT 4
- Empty string user id's silently fail to send events HOT 1
- window._cio.page is not a function HOT 2
- override listid for mailchimp HOT 5
- Modify timestamp to have 3 fractional digits
- Convert project to Github Actions
- Missing some tracked events in debugger HOT 2
- ::Segment is too generic a namespace HOT 1
- API returns a 200 with wrong auth key HOT 6
- Convert to Github Actions HOT 1
- wrong argument type nil (expected String) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics-ruby.