Custom Templates for DeepL backed up and EmailMonkey. GS University was also re-downloaded. Then small scripts updated like for Chubb.
This commit is contained in:
@ -1,3 +1,46 @@
|
||||
{% if current_person.signed_in? %}
|
||||
{% assign splitted_email = current_person.email | split: "@" %}
|
||||
{% assign splitted_domain = splitted_email[1] | split: "." %}
|
||||
{% assign account_name = splitted_domain[0] %}
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const cookieName = 'GSUTimestamp';
|
||||
const cookieValue = document.cookie.split('; ').find(row => row.startsWith(cookieName + '='));
|
||||
const currentTimestamp = Date.now();
|
||||
|
||||
if (!cookieValue) {
|
||||
document.cookie = `${cookieName}=${currentTimestamp}; path=/`;
|
||||
identifyLearner();
|
||||
return;
|
||||
}
|
||||
|
||||
const cookieTimestamp = parseInt(cookieValue.split('=')[1], 10);
|
||||
const thirtyMinutesInMillis = 30 * 60 * 1000;
|
||||
if (currentTimestamp > cookieTimestamp + thirtyMinutesInMillis) {
|
||||
document.cookie = `${cookieName}=${currentTimestamp}; path=/`;
|
||||
identifyLearner();
|
||||
}
|
||||
});
|
||||
|
||||
function identifyLearner() {
|
||||
aptrinsic('identify',
|
||||
{
|
||||
'id': "{{ current_person.id }}",
|
||||
'email': "{{ current_person.email }}",
|
||||
'signedUpAt': new Date("{{ current_person.created_at }}").getTime(),
|
||||
'firstName': "{{ current_person.first_name }}",
|
||||
'lastName': "{{ current_person.last_name }}"
|
||||
},
|
||||
{
|
||||
'id': "{{ account_name }}",
|
||||
'name': "{{ account_name }}"
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<header class="np-header np-header-color">
|
||||
<div class="np-header-top np-hidden-mobile">
|
||||
<ul class="np-header-top-nav">
|
||||
|
||||
Reference in New Issue
Block a user