Segment.io plugin for Discourse


(Travis) #1

I’m attempting to write my first plugin for Discourse. Something I want for my own forum: Segment.io integration.

https://github.com/vocino/segment-discourse

One thing I like about Segment is that, once set up, I can simply enable and disable items in my Segment dashboard and I’ll have user and usage data pushed to those services.

I don’t know much about writing plugins for discourse and this does not work yet. I figured I would post in here in case anyone was interested in having Segment and wanted to contribute to the project.

Here is the ruby integration: Segment

I think we have to use the ruby integration rather than the more simple JS-only because of all the ajax stuff going on in Discourse. We would want to track those items for integrations like Mixpanel and whatnot.


Discourse and segment.io integration
(Jonathan Williamson) #2

@Vocino I’m interested in this as well. Have you done any more work on this, or is it working yet?

I don’t have much experience in Ruby, but I’m currently working on an Easy Digital Downloads integration for Segment in PHP.


(Dima Starodubcev) #3

Very interested. Does it work well?
Update:
I try to install it but…

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 310 exit 255>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
8623947f2596d893bfbf55cdeb1bf15ba123f8e04e2557b75a8d747d4e78dac4

(Bali Bebas!) #4

I used to use Segment back in my 9-5 days and, while they’re primarily targeted at businesses, the service can still be useful as a hosted alternative to GA and sports an easy-to-use analytics library: GitHub - segmentio/analytics.js: The hassle-free way to integrate analytics into any web application.

The repo the OP mentioned is gone now but I did a quick search on GitHub and found this, which is a couple years old but may be useful for anyone attempting to revive this plugin: