Содержание
Обновил Anton Ruhl 10 месяцев назад
### **Integrate PostHog with JavaScript web** ## asdff
[Read the docs](https://posthog.com/docs/libraries/js) /
### **Install**
```bash <div data-type="imageUpload">
npm install posthog-js
# OR
yarn add posthog-js
# OR
pnpm add posthog-js
```
### **Initialize**
```javascript
import posthog from 'posthog-js'
posthog.init('phc_Y9FEQu1ZiVSyvBjxQ5ctAibmWfthLkWvsHx7dYW4I0B',
{
api_host: 'https://hosthog.u-meteor.ru',
person_profiles: 'identified_only' // or 'always' to create profiles for anonymous users as well
}
)
```
#### **Send events**
Click around and view a couple pages to generate some events. Our package automatically captures them for you.
#### **Optional: Send a manual event**
If you'd like, you can manually define events, too.
```javascript
posthog.capture('my event', { property: 'value' })
```
## kljlkjlkjkjlk jk kjd kjdf ksf sf sf sfsf
sfasf
- `lkjslfkjaglkjf`
- lkjlaksgjlaksgj
lkjlkjsgsag
/ </div>
[Read the docs](https://posthog.com/docs/libraries/js)
### **Install**
```bash
npm install posthog-js
# OR
yarn add posthog-js
# OR
pnpm add posthog-js
```
### **Initialize**
```javascript
import posthog from 'posthog-js'
posthog.init('phc_Y9FEQu1ZiVSyvBjxQ5ctAibmWfthLkWvsHx7dYW4I0B',
{
api_host: 'https://hosthog.u-meteor.ru',
person_profiles: 'identified_only' // or 'always' to create profiles for anonymous users as well
}
)
```
#### **Send events**
Click around and view a couple pages to generate some events. Our package automatically captures them for you.
#### **Optional: Send a manual event**
If you'd like, you can manually define events, too.
```javascript
posthog.capture('my event', { property: 'value' })
```
## kljlkjlkjkjlk jk kjd kjdf ksf sf sf sfsf
sfasf
- `lkjslfkjaglkjf`
- lkjlaksgjlaksgj
lkjlkjsgsag
/