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: twitter_username
, lens_handle
and farcaster_id
described below. (note these field names are case sensitive).
twitter_username
string
Required *
*Optional when lens_handle
or farcaster_id
is set
Twitter/X username. For example, for https://x.com/safaryclub, send only "safaryclub".
lens_handle
string
Required *
*Optional when twitter_username
or farcaster_id
is set
Lens handle without the namespace. For example, for https://hey.xyz/u/ricardocarvalho send only "ricardocarvalho"
farcaster_id
number
Required *
*Optional when twitter_username
or farcaster_id
is set
Farcaster ID (aka FID). For example, for https://warpcast.com/jhv click on the three dots and then click on "About" to see the FID of 1385.
Example only with required twitter_username
field:
safary.track({
eventType: "social_login",
eventName: "login-using-twitter",
parameters: {
twitter_username: "elonmusk"
}
})
Example only with required lens_handle
field:
safary.track({
eventType: "social_login",
eventName: "login-using-lens",
parameters: {
lens_handle: "ricardocarvalho"
}
})
Example only with required farcaster_id
field:
safary.track({
eventType: "social_login",
eventName: "login-using-farcaster",
parameters: {
farcaster_id: "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
+eventName
are 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
parameters
used in the both tracking functions is required to be an object.Therefore, for example, passing a string as
parameters
would not work:
safary.track( { eventType: "buy", eventName: "main offer", parameters: "ETH" } )
// Gives:
// ERROR: safary.track(): parameters is not an object.
Last updated