대화 앱(예를 들어 댓글, 채팅, 라이브 블로그, 검토 및 방주)에 JavaScript를 바인딩할 수 있는 이벤트.
Livefyre는 Livefyre 앱의 사용자 활동을 추적하는 JavaScript 이벤트를 제공합니다. 예를 들어 사용자가 Twitter 또는 Facebook에 컨텐츠를 좋아하거나 공유할 때 또는 새 컨텐츠가 게시될 때 페이지를 업데이트할 수 있습니다.
또한 Livefyre를 사용하면 타사 분석 통합(Adobe Analytics JS, Google Analytics, 다이내믹 태그 관리 등)에 이벤트를 추가하여 앱 이벤트를 추적할 수 있습니다. 자세한 내용은 제3자 통합 관리자와 함께 올바른 이벤트를 제공합니다.
이러한 이벤트에 바인딩하려면 페이지에 앱을 인스턴스화할 때 다음 코드를 페이지에 추가하십시오. 이벤트 이름을 {eventName}
으로 바꿉니다.
Livefyre.require(['fyre.conv#3'], function(Conv) {
new Conv(networkConfig, [convConfig], function(widget) {
widget.on('{eventName}', function (data) {
// Do something, perhaps using data
});
});
});
데이터 객체는 모든 이벤트 핸들러에 대해 제공됩니다. 각 이벤트 다음에 나오는 데이터 개체의 예입니다.
사용자가 댓글을 게시했습니다.
data = {
authorId: "_u2012@livefyre.com" // The ID of the author of the comment
parent: "893549"
// The ID of the comment that this new comment is in reply to, else null
bodyHtml: "<p>42</>" // The HTML of the submitted Content
sharedToFacebook:true // Whether the comment was also posted to Facebook
sharedToTwitter:false // Whether the comment was also posted to Twitter
title: "demo title" // The title of the review (exists only for Reviews)
rating: [90] // Array of ratings for the review (exists only for Reviews)
}
사용자가 댓글에 플래그를 지정했습니다.
data = {
targetId: "789347" // The ID of the comment that was flagged
type: ["disagree"] // The type of flag
notes: ["I don't entirely agree with this post"] // A note/reason for the flag
}
사용자가 댓글을 좋아했습니다.
data = {
targetId: "245625" // The ID of the comment that was liked
targetAuthorId: "i_am_author@livefyre.com"
// The ID of the author of the comment that was liked
}
사용자가 스트림에서 댓글을 공유했습니다. (사용자가 주석 편집기에서 공유할 때는 이 이벤트가 발생하지 않습니다.) 이 이벤트는 [공유] 단추를 클릭하면 트리거됩니다.
data = {
targetId: "256255" // The ID of the comment that was shared
sharedToFacebook:false // Whether the comment was shared to Facebook
sharedToTwitter:true // Whether the comment was shared to Twitter
}
이 대화에 표시되는 총 댓글 수가 변경되었습니다(증가하거나 감소됨).
data: 34 // The total number of visible comments in the conversation (integer).
사용자가 로그인했습니다.
data = {
avatar: "https://gravatar.com/avatar/50.jpg"
// Link to logged in user's avatar image
displayName: "NewUser" // Display name of the logged in user
id: "newuser@livefyre.com" // ID of the logged in user
isModerator:false // Boolean indicating whether logged in user is a moderator
}
사용자가 로그아웃되었습니다.
데이터가 정의되지 않았습니다.
사용자가 댓글에 @mention을 포함했습니다. 다음 배열을 반환합니다.
data = {
id: '111111@fb.gw.livefyre.com' // ID of the mentioned user
displayName: 'testUser' // Display name of mentioned user
message: "@testUser Wow, I can't believe it either!"
// Message that was sent to the particular user
provider: 'twitter' // Provider to which the mention was shared
}
중재자 사용자가 댓글을 달았습니다. 다음 배열을 반환합니다.
data = {
targetId: "134234" // The ID of the comment that was featured
targetAuthorId: "i_am_author@livefyre.com"
// The ID of the author of the comment that was featured
}
주석 스트림이 로드되었으며 초기 컨텐츠 세트가 서버에서 가져와서 사용자에게 표시됩니다.
데이터가 정의되지 않았습니다.
사용자가 Show More 단추를 클릭했습니다.
데이터가 정의되지 않았습니다.
사용자가 Follow 단추를 클릭하면 true를 반환하고 내용이 스트림에 게시되면 false를 반환합니다.
data = {
id: 'authorId@livefyre.com',
optIn: true
}
사용자가 Unfollow 단추를 클릭하면 true를 반환하고 내용이 스트림에 게시되면 false를 반환합니다.
data = {
id: 'authorId@livefyre.com',
optOut: true
}