Hi Romain, I can send a page view but I would like to send an event. On 3.4 it is mentioned that the tracker is an integration of analytics.js. If you visit https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/ you can see the track method, which unomiTracker also seems to have.
I just wanted to send an event not a pageview. Im using Clearbit to enrich who is visiting, so when Clearbit finished I would like to send an event with some properties just like it is done through the curl -X POST http://localhost:8181/eventcollector \ but using the unomiTracker. I've worked with Segment before and this is how their tracker works. If you go to their website console and type: analytics.track("MyCraZyEvent", properties,) this will fire an event. What am I missing here? The track method lets you record any actions your users perform. You can see a track example in the guide <https://segment.com/docs/tutorials/quickstart-analytics.js#step-3-track-actions> or find details on the track method payload <https://segment.com/docs/connections/spec/track>. track method definition: analytics.track(event, [properties], [options], [callback]); 3.4. WEB TRACKER This extension is providing the web tracker to start collecting visitors data on your website. The tracker is implemented as an integration of analytics.js <https://github.com/segmentio/analytics.js> for Unomi. curl -X POST http://localhost:8181/eventcollector \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "sessionId" : "1234", "events":[ { "eventType":"contactInfoSubmitted", "scope": "example", "source":{ "itemType": "site", "scope":"example", "itemId": "mysite" }, "target":{ "itemType":"form", "scope":"example", "itemId":"contactForm" }, "properties" : { "firstName" : "John", "lastName" : "Doe", "email" : "john....@acme.com" } } ] } EOF Thanks Joao -- *João Correia* San Diego, CA mobile: +1 (858) 284-6010 web: https://joaocorreia.io On Wed, Nov 27, 2019 at 2:34 AM Romain Gauthier <rgauth...@jahia.com> wrote: > Hello Joao, > > To send the page views, the tracker has a .page method, you can section > 3.4.3 here: https://unomi.apache.org/manual/latest/#_tracking_page_views > > You can also check the example that is deployed with Unomi: > http://localhost:8181/tracker/ > > To identify a user, you can check the doc on the login event, I think it's > where you'll have the best information: > https://unomi.apache.org/manual/latest/#_how_to_send_a_login_event_to_unomi > The idea is to register a rule in Unomi that will react on the login > events and ensure that all events and properties associated with a profile > based on cookie are merged with the ones that belong to the named / > authenticated profile. > > I don't know if the "identify" method of the tracker has actually been > mapped to any inner logic in Unomi, if it's not the case, that looks like a > great thing to do. > > Romain > > > > On Wed, 27 Nov 2019 at 07:57, João Correia <joao.corr...@gmail.com> wrote: > >> Hi Unomiers, >> >> Discovered Unomi yesterday and got it set up today!. Works nicely on >> pageviews but I would like to fire a identify or event to identify the >> profile. >> >> I'm having trouble sending events using the JS tracker. This is how I'm >> trying sending an event: >> >> properties = >> { >> "eventType":"Whatsup", >> "scope": "example", >> "source":{ >> "itemType": "site", >> "scope":"example", >> "itemId": "mysite" >> }, >> "target":{ >> "itemType":"form", >> "scope":"example", >> "itemId":"contactForm" >> }, >> "properties" : { >> "firstName" : "John", >> "lastName" : "Doe", >> "email" : "john....@acme.com" >> } >> } >> >> window.unomiTracker.track("MyEvent", properties); >> >> I look at the network tab and Im also on unomi:event-tail and nothing >> comes through. Also tried identify it goes into local storage but doesn't >> get sent. >> >> window.unomiTracker.identify({ >> nickname: 'Amazing Grace', >> favoriteCompiler: 'A-0', >> industry: 'Computer Science' >> }); >> >> Does anyone have any examples of how to fire an event using the >> Javascript Tracker? >> >> Thanks >> Joao Correia >> >> -- >> >> *João Correia* >> >> San Diego, CA >> mobile: +1 (858) 284-6010 >> web: https://joaocorreia.io >> >> >> >> >> >> >> >> >> >> >> >> > > -- > Romain Gauthier > Product Manager at Jahia > + 33 6 20 18 35 25 > 8 Rue du sentier | 75002 Paris | France >