customerio / customerio-ruby

A ruby client for the Customer.io event API.
https://customer.io/docs/api/
MIT License
65 stars 75 forks source link

How to track page view events? #92

Closed pauljacksonrodgers closed 1 year ago

pauljacksonrodgers commented 1 year ago

I see methods like trackPageView in the Python SDK, but not in this Ruby SDK. Based on the suggestion here, I tried sending the page view events like

client.track(15, 'page', path: '/whatever')

but those just appear as "regular" events in the activity log, not actually events of type pageView. How can I use this SDK to send events that will actually come through to the dashboard as page views?

hownowstephen commented 1 year ago

following up here @pauljacksonrodgers you should be able to use the new pageview method in v4.3.2 for this - depending on how you want to model the data in Customer.io, you can either use a full URL or just a fragment like in your example above

client.pageview(15, 'http://example.com/page')
client.pageview(15, '/page')

https://rubygems.org/gems/customerio/versions/4.3.2