Mixpanel Pharo Smalltalk Client Library
Pharo Smalltalk 4.0, 5.0, 6.0, 6.1
Metacello new
baseline: 'Mixpanel';
repository: 'github://newapplesho/mixpanel-smalltalk/pharo-repository';
load."Mixpanel project token, PROJECT_TOKEN"
MixpanelSettings default token:'PROJECT_TOKEN'.tracker := MixpanelTracker new.
tracker track:'Sent Message'.tracker := MixpanelTracker new.
json := NeoJSONObject new.
json at:'Programming language' put:'Pharo Smalltalk'.
json at:'version' put:'4.0'.
tracker track:'Sent Message' properties: json.tracker := MixpanelTracker new.
json := MixpanelEngagementJsonObject new.
json browser:'Safari'.
json os:'Mac'.
json referrer:'http://www.sorabito.com/'.
json currentUrl:'https://allstocker.com/'.
" XXXX.XXXX.XXXX.XXXX is ip address. "
tracker track:'Sent Message' properties: json ip:'XXXX.XXXX.XXXX.XXXX'.The Mixpanel library will assign a default unique identifier (we call it "distinct_id") to each unique user who comes to your website.
tracker := MixpanelTracker new.
"distinct_id 13793"
tracker identify:'13793'.
tracker track:'Sent Message'.tracker := MixpanelTracker new.
tracker identify:'13793'.
people := tracker people.
json := MixpanelPeopleJsonObject new.
json firstname:'Sho'.
json lastname:'Yoshida'.
json at:'Favorite programming language' put:'Smalltalk'.
people setUserProfiles: json.