Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traits.SetCreatedAt converts time.Time to Unix timestamp #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Noah-Codex
Copy link

@Noah-Codex Noah-Codex commented Dec 13, 2024

Before

When uploading a time.Time value to the reserved createdAt attribute, the API succeeds with status 200 OK, but displays an Invalid Date when viewing the People tab in Journeys.

In fact, attempting to Round or Truncate the time.Time in any fashion has the same results.

Screenshot 2024-12-13 at 8 50 13 AM
Screenshot 2024-12-13 at 8 49 46 AM

After

I then noticed that a default segment documents created_at to expect a UNIX timestamp.

Screenshot 2024-12-13 at 8 53 39 AM

When instead manually setting the createdAt as shown below, I instead got the desired result.

identify := analytics.Identify{
	Traits: analytics.NewTraits().
		Set("createdAt", time.Now().Unix()),
	UserId: userID,
}

Result

Screenshot 2024-12-13 at 8 55 03 AM

Screenshot 2024-12-13 at 8 55 23 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant