Merge pull request #766 from jmfrouin/745

[Evol/#745] Service Marketo
This commit is contained in:
Amauri CHAMPEAUX 2021-08-14 16:30:58 +02:00 committed by GitHub
commit 28cff26d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 0 deletions

View File

@ -4373,3 +4373,37 @@ tarteaucitron.services.bandcamp = {
});
}
};
// Marketo munchkin
tarteaucitron.services.marketomunchkin = {
"key": "marketomunchkin",
"type": "api",
"name": "Marketo munchkin",
"uri": "https://documents.marketo.com/legal/cookies",
"needConsent": true,
"cookies": ['OptAnon', '_mkto_trk'],
"js": function () {
"use strict";
if (tarteaucitron.user.marketomunchkinkey === undefined) {
return;
}
var didInit = false;
function initMunchkin() {
if(didInit === false) {
didInit = true;
Munchkin.init(tarteaucitron.user.marketomunchkinkey);
}
}
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//munchkin.marketo.net/munchkin.js';
s.onreadystatechange = function() {
if (this.readyState == 'complete' || this.readyState == 'loaded') {
initMunchkin();
}
};
s.onload = initMunchkin;
document.getElementsByTagName('head')[0].appendChild(s);
}
};