Skip to content

Commit

Permalink
snapchatEmail not mandatory fix #963
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauriC committed Feb 27, 2024
1 parent 67a98af commit 941c8c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions tarteaucitron.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,17 +838,22 @@ tarteaucitron.services.snapchat = {
"js": function () {
"use strict";

if (tarteaucitron.user.snapchatId === undefined || tarteaucitron.user.snapchatEmail === undefined) {
if (tarteaucitron.user.snapchatId === undefined) {
return;
}

var a = window.snaptr = function() {
a.handleRequest ? a.handleRequest.apply(a, arguments) : a.queue.push(arguments)
};
a.queue = [];
window.snaptr('init', tarteaucitron.user.snapchatId, {
'user_email': tarteaucitron.user.snapchatEmail
});

if (tarteaucitron.user.snapchatEmail === undefined) {
window.snaptr('init', tarteaucitron.user.snapchatId);
} else {
window.snaptr('init', tarteaucitron.user.snapchatId, {
'user_email': tarteaucitron.user.snapchatEmail
});
}
window.snaptr('track', 'PAGE_VIEW');

tarteaucitron.addScript('https://sc-static.net/scevent.min.js');
Expand Down
2 changes: 1 addition & 1 deletion tarteaucitron.services.min.js

Large diffs are not rendered by default.

0 comments on commit 941c8c5

Please sign in to comment.