Vue
LogSnag client for Vue applications
Last updated
import { setUserId, track, identify } from "@logsnag/vue";
// Set the user id for the current user
setUserId('user-123');
// Track an event
track({
channel: "payments",
event: "New Subscription",
user_id: "user-123",
icon: "💰",
notify: true,
tags: {
plan: "premium",
cycle: "monthly",
trial: false
}
});
// Identify a user
identify({
user_id: "user-123",
properties: {
name: "John Doe",
email: "john@doe.com",
plan: "premium",
}
});<button
data-event="Upgraded Plan"
data-channel="billing"
data-icon=":moneybag:"
data-tag-plan="Pro"
data-tag-period="Monthly"
data-tag-price="9.99"
>
Upgrade to Pro
</button>