File tree Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,22 @@ You may want to disable ip geolocation when using a server-side SDK. You can lea
47
47
48
48
</Tab>
49
49
50
+ <Tab>
51
+ ` ` ` shell php
52
+ // create/update a profile for user id 12345
53
+ $mp- > people- > set (' USER_ID' , array (
54
+ ' $first_name' => " John" ,
55
+ ' $last_name' => " Doe" ,
56
+
57
+ ' $phone' => " 5555555555" ,
58
+ " Favorite Color" => " red"
59
+ ));
60
+ ````
61
+
62
+ You may want to disable ip geolocation when using a server- side SDK . You can learn more in [Server- Side Best Practices](/ docs/ tracking- best- practices/ server- side- best- practices)
63
+
64
+ < / Tab>
65
+
50
66
< Tab>
51
67
` ` ` javascript
52
68
mixpanel.people.set('USER_ID', {
Original file line number Diff line number Diff line change @@ -80,6 +80,39 @@ mp = Mixpanel("YOUR_TOKEN")
80
80
````
81
81
< / Tab>
82
82
83
+ < Tab>
84
+ # #### Install the SDK
85
+
86
+ ** Install with Composer**
87
+
88
+ 1 . Add mixpanel/ mixpanel- php as a dependency and run composer update:
89
+
90
+ ```shell php
91
+ " require" : {
92
+ ...
93
+ " mixpanel/mixpanel-php" : " 2.*"
94
+ ...
95
+ }
96
+ ```
97
+ ** Install Manually**
98
+
99
+ 1 . [ Download the Mixpanel PHP Library] ( https://github.com/mixpanel/mixpanel-php/archive/master.zip )
100
+ 2 . Extract the zip file to a directory called "mixpanel-php" in your project root
101
+
102
+ ##### Configure the SDK
103
+ Replace ` YOUR_TOKEN ` with your project token. You can find your token [ here] ( https://mixpanel.com/settings/project ) .
104
+ ``` shell php
105
+ < ? php
106
+ // import Mixpanel
107
+ require ' mixpanel-php/lib/Mixpanel.php' ;
108
+
109
+ // get the Mixpanel class instance, replace with your project token
110
+ $mp = Mixpanel::getInstance(" YOUR_TOKEN" );
111
+
112
+ ? >
113
+ ````
114
+ < /Tab>
115
+
83
116
< Tab>
84
117
# #### Install the SDK
85
118
` ` ` shell Node.js
Original file line number Diff line number Diff line change @@ -50,6 +50,19 @@ _ Github: [Browse the Open Source SDKs](https://github.com/mixpanel)
50
50
51
51
</Tab >
52
52
53
+ <Tab >
54
+ ``` shell php
55
+ $mp -> track(" button clicked" , array(" label" => " sign-up" ));
56
+ ```
57
+
58
+ 🎉 Congratulations, you've tracked your first event! You can see it in Mixpanel via the [ Events page] ( https://mixpanel.com/report/events ) .
59
+
60
+ ** More resources:**
61
+ _ Docs: [ Read the Python SDK Doc] ( /docs/tracking-methods/sdks/php/ )
62
+ _ Github: [ Browse the Open Source SDKs] ( https://github.com/mixpanel )
63
+
64
+ </Tab >
65
+
53
66
<Tab >
54
67
``` js Node.js
55
68
// Note: you must supply the USER_ID
Original file line number Diff line number Diff line change 1
1
export const dataItems = {
2
2
'javascript' : `Javascript` ,
3
3
'python' : `Python` ,
4
+ 'php' : `PHP` ,
4
5
'node' : `Node` ,
5
6
'go' : `Go` ,
6
7
'ruby' : `Ruby` ,
You can’t perform that action at this time.
0 commit comments