[Solved!] Sending data to Segment
![Alex Rothera](https://us.v-cdn.net/6037124/user_avatars/5576229.jpg)
Has anyone had success setting up Segment yet? I might be close but I still don't have data flowing yet.
As far as I've gotten is making this custom function that attempts to post data to Segment. It returns a "200" code so I believe that means it's working?
Step 1: Function setup to send data to Segment[Screen Shot 2022-07-26 at 2.57.55 PM.png]Step 2: Call the function side a Get Request my UI is already using for a tracking event.
[image.png]Final Result: Debugger looks good (?) but Segment doesn't tell me data is flowing
[Screen Shot 2022-07-26 at 3.01.41 PM.png]
Comments
-
Just an update from office hours: We figured out Segment always sends a 200 status code and all debugging is done inside their debugger. We were able to figure out, per Segment's documentation, we needed to add a colon to the end of the auth key and apply the base64_encode filter. This got us a successful call.
-
Thanks Michael! Yes we did it!
I'll try and release the function on Xano soon, but just quickly here is how to send data to Segment below:
[Screen Shot 2022-07-29 at 11.36.09 AM.png][Screen Shot 2022-07-29 at 11.39.30 AM.png][Screen Shot 2022-07-29 at 11.39.41 AM.png] -
Thanks so much man, do we have to integrate SDK with xano or just straight use segment's API ?
-
I didn't do any integration. Just sent it and all good
-
What happened to the screenshots? I am trying to do the same thing 😭 I think I have an idea of what to do, but this seems to be exactly what I need to implement a solution! Any help is appreciated!
-
Hi @jason.jones (and @Erun I think this might help you too) —
While again we don't provide support for other API's, this is something that got worked through in a past office hours as Michael mentioned above.
According to Segment's API documentation:
Segment returns a 200 response for all API requests except errors caused by large payloads and JSON errors (which return 400 responses.) To debug events that return 200 responses but aren’t accepted by Segment, use the Segment Debugger.
Also, according to their documentation, you need to a colon to the end of the Segment auth key and apply the
base64_encode
filter to that.Keep in mind they also use
Authorization: Basic
instead ofBearer
. Then you can usereplace
orsprintf
to add the base64 version of the auth key.Hope that helps!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback