Twitter Auth
Social Login Event
The social_login event can be used to track information regarding logins made using socials. To track a social login event, use the track function with "social_login" as the eventType, and any appropriate name as eventName, and make sure to add the required attributes in the field parameters.
The parameters field should contain at least one of the three possible fields: twitterUsername, lensHandle and farcasterId described below. (note these field names are case sensitive).
twitterUsername
string
Required *
*Optional when lensHandle or farcasterId is set
Twitter/X username. For example, for https://x.com/safaryclub, send only "safaryclub".
lensHandle
string
Required *
*Optional when twitterUsername or farcasterId is set
Lens handle without the namespace. For example, for https://hey.xyz/u/ricardocarvalho send only "ricardocarvalho"
farcasterId
number
Required *
*Optional when twitterUsername or farcasterId is set
Farcaster ID (aka FID). For example, for https://farcaster.xyz/jhv click on the three dots and then click on "About" to see the FID of 1385.
Example only with required twitterUsername field:
safary.track({
eventType: "social_login",
eventName: "login-using-twitter",
parameters: {
twitterUsername: "elonmusk"
}
})Example only with required lensHandle field:
safary.track({
eventType: "social_login",
eventName: "login-using-lens",
parameters: {
lensHandle: "ricardocarvalho"
}
})Example only with required farcasterId field:
safary.track({
eventType: "social_login",
eventName: "login-using-farcaster",
parameters: {
farcasterId: "jhv"
}
})Please note that the parameters field can also include any other information you believe is useful to track, as long as you follow the guidelines in the Custom Parameters subsection.
See the last section of this page for troubleshooting.
Troubleshooting
Required arguments:
Note that
eventType+eventNameare required arguments forsafary.track.Therefore, for example, the following would not work:
safary.track( { eventName: "main offer" } )
// Gives:
// ERROR: safary.track(): eventType is undefined.Required format:
Note that the
parametersused in the both tracking functions is required to be an object.Therefore, for example, passing a string as
parameterswould not work:
safary.track( { eventType: "buy", eventName: "main offer", parameters: "ETH" } )
// Gives:
// ERROR: safary.track(): parameters is not an object.Last updated