Skip to content

Commit 853e60d

Browse files
Merge pull request #13 from axelson/properties-doc-changes
2 parents acbfe31 + b7ee863 commit 853e60d

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

lib/posthog.ex

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ defmodule Posthog do
3333
# Event with properties
3434
Posthog.capture("purchase", [
3535
distinct_id: "user_123",
36-
properties: %{
37-
product_id: "prod_123",
38-
price: 99.99
39-
}
36+
product_id: "prod_123",
37+
price: 99.99
4038
])
4139
4240
# Event with custom timestamp
@@ -74,7 +72,7 @@ defmodule Posthog do
7472
7573
events = [
7674
{"page_view", [distinct_id: "user_123"], nil},
77-
{"button_click", [distinct_id: "user_123", properties: %{button: "signup"}], nil}
75+
{"button_click", [distinct_id: "user_123", button: "signup"], nil}
7876
]
7977
8078
Posthog.batch(events)
@@ -107,10 +105,8 @@ defmodule Posthog do
107105
# Event with properties
108106
Posthog.capture("purchase", [
109107
distinct_id: "user_123",
110-
properties: %{
111-
product_id: "prod_123",
112-
price: 99.99
113-
}
108+
product_id: "prod_123",
109+
price: 99.99
114110
])
115111
116112
# Event with timestamp
@@ -140,7 +136,7 @@ defmodule Posthog do
140136
141137
events = [
142138
{"page_view", [distinct_id: "user_123"], nil},
143-
{"button_click", [distinct_id: "user_123", properties: %{button: "signup"}], nil}
139+
{"button_click", [distinct_id: "user_123", button: "signup"], nil}
144140
]
145141
146142
Posthog.batch(events)

lib/posthog/client.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ defmodule Posthog.Client do
132132
Posthog.Client.capture("purchase",
133133
%{
134134
distinct_id: "user_123",
135-
properties: %{product_id: "123", price: 99.99}
135+
product_id: "123",
136+
price: 99.99
136137
},
137138
timestamp: DateTime.utc_now()
138139
)
@@ -166,7 +167,7 @@ defmodule Posthog.Client do
166167
167168
events = [
168169
{"page_view", %{distinct_id: "user_123"}, nil},
169-
{"click", %{distinct_id: "user_123", properties: %{button: "signup"}}, DateTime.utc_now()}
170+
{"click", %{distinct_id: "user_123", button: "signup"}, DateTime.utc_now()}
170171
]
171172
172173
Posthog.Client.batch(events)

0 commit comments

Comments
 (0)