让我知道这个是否奏效!我修改了一些我拥有的代码,这些代码也将在成员第一次登录到他们的 Memberstack 元数据时添加。
尝试在站点范围的 </ body > 标记之前添加此代码:
<script>
MemberStack.onReady.then(async function(member) {
// if member is logged in
if(member.loggedIn){
var first_logged_in_timestamp = member["first-logged-in-timestamp"];
if(first_logged_in_timestamp === undefined || first_logged_in_timestamp == null || first_logged_in_timestamp.length < 1)
{ // set first-logged-in-timestamp
var first_logged_in_timestamp = timestamp;
member.updateProfile({
"first-logged-in-timestamp": timestamp,
}, false)
}
window.location.href='https://RedirectHereIfFirstLogIn.com';
}
else{
window.location.href='https://RedirectHereIfNotLoggedIn.com';
}
}
</script>