tarteaucitron.services.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. /*global tarteaucitron, ga, Shareaholic, stLight, clicky, top*/
  2. /*jslint regexp: true, nomen: true*/
  3. // addthis
  4. tarteaucitron.services.addthis = {
  5. "key": "addthis",
  6. "type": "social",
  7. "name": "AddThis",
  8. "uri": "http://www.addthis.com/privacy/privacy-policy#publisher-visitors",
  9. "needConsent": true,
  10. "cookies": ['__atuvc', '__atuvs'],
  11. "js": function () {
  12. "use strict";
  13. if (tarteaucitron.user.addthisPubId === undefined) {
  14. return;
  15. }
  16. tarteaucitron.fallback(['addthis_sharing_toolbox'], '');
  17. tarteaucitron.addScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=' + tarteaucitron.user.addthisPubId);
  18. },
  19. "fallback": function () {
  20. "use strict";
  21. var id = 'addthis';
  22. tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id));
  23. }
  24. };
  25. // alexa
  26. tarteaucitron.services.alexa = {
  27. "key": "alexa",
  28. "type": "analytic",
  29. "name": "Alexa",
  30. "uri": "http://www.alexa.com/help/privacy",
  31. "needConsent": true,
  32. "cookies": ['__asc', '__auc'],
  33. "js": function () {
  34. "use strict";
  35. if (tarteaucitron.user.alexaAccountID === undefined) {
  36. return;
  37. }
  38. window._atrk_opts = {
  39. atrk_acct: tarteaucitron.user.alexaAccountID,
  40. domain: window.location.hostname.match(/[^\.]*\.[^.]*$/)[0],
  41. dynamic: true
  42. };
  43. tarteaucitron.addScript('https://d31qbv1cthcecs.cloudfront.net/atrk.js');
  44. }
  45. };
  46. // clicky
  47. tarteaucitron.services.clicky = {
  48. "key": "clicky",
  49. "type": "analytic",
  50. "name": "Clicky",
  51. "uri": "https://clicky.com/terms",
  52. "needConsent": true,
  53. "cookies": ['_jsuid', '_eventqueue', '_referrer_og', '_utm_og', '_first_pageview', 'clicky_olark', 'no_trackyy_' + tarteaucitron.user.clickyId, 'unpoco_' + tarteaucitron.user.clickyId, 'heatmaps_g2g_' + tarteaucitron.user.clickyId],
  54. "js": function () {
  55. "use strict";
  56. if (tarteaucitron.user.clickyId === undefined) {
  57. return;
  58. }
  59. tarteaucitron.addScript('//static.getclicky.com/js', '', function () {
  60. if (typeof clicky.init === 'function') {
  61. clicky.init(tarteaucitron.user.clickyId);
  62. }
  63. if (typeof tarteaucitron.user.clickyMore === 'function') {
  64. tarteaucitron.user.clickyMore();
  65. }
  66. });
  67. }
  68. };
  69. // dailymotion
  70. tarteaucitron.services.dailymotion = {
  71. "key": "dailymotion",
  72. "type": "video",
  73. "name": "Dailymotion",
  74. "uri": "http://www.dailymotion.com/legal/privacy",
  75. "needConsent": true,
  76. "cookies": ['ts', 'dmvk', 'hist', 'v1st', 's_vi'],
  77. "js": function () {
  78. "use strict";
  79. tarteaucitron.fallback(['dailymotion_player'], function (x) {
  80. var video_id = x.getAttribute("videoID"),
  81. video_width = x.getAttribute("width"),
  82. frame_width = 'width=',
  83. video_height = x.getAttribute("height"),
  84. frame_height = 'height=',
  85. video_frame;
  86. if (video_id === undefined) {
  87. return "";
  88. }
  89. if (video_width !== undefined) {
  90. frame_width += '"' + video_width + '" ';
  91. } else {
  92. frame_width += '"" ';
  93. }
  94. if (video_height !== undefined) {
  95. frame_height += '"' + video_height + '" ';
  96. } else {
  97. frame_height += '"" ';
  98. }
  99. video_frame = '<iframe src="//www.dailymotion.com/embed/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" allowfullscreen></iframe>';
  100. return video_frame;
  101. });
  102. },
  103. "fallback": function () {
  104. "use strict";
  105. var id = 'dailymotion';
  106. tarteaucitron.fallback(['dailymotion_player'], tarteaucitron.engage(id));
  107. }
  108. };
  109. // disqus
  110. tarteaucitron.services.disqus = {
  111. "key": "disqus",
  112. "type": "comment",
  113. "name": "Disqus",
  114. "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
  115. "needConsent": true,
  116. "cookies": [],
  117. "js": function () {
  118. "use strict";
  119. if (tarteaucitron.user.disqusShortname === undefined) {
  120. return;
  121. }
  122. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js');
  123. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js');
  124. },
  125. "fallback": function () {
  126. "use strict";
  127. var id = 'disqus';
  128. if (document.getElementById('disqus_thread')) {
  129. document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
  130. }
  131. }
  132. };
  133. // facebook
  134. tarteaucitron.services.facebook = {
  135. "key": "facebook",
  136. "type": "social",
  137. "name": "Facebook",
  138. "uri": "https://www.facebook.com/help/cookies/",
  139. "needConsent": true,
  140. "cookies": [],
  141. "js": function () {
  142. "use strict";
  143. tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-comments', 'fb-activity', 'fb-like-box', 'fb-send', 'fb-share-button', 'fb-like'], '');
  144. tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
  145. },
  146. "fallback": function () {
  147. "use strict";
  148. var id = 'facebook';
  149. tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-comments', 'fb-activity', 'fb-like-box', 'fb-send', 'fb-share-button', 'fb-like'], tarteaucitron.engage(id));
  150. }
  151. };
  152. // ferank
  153. tarteaucitron.services.ferank = {
  154. "key": "ferank",
  155. "type": "analytic",
  156. "name": "FERank",
  157. "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
  158. "needConsent": false,
  159. "cookies": [],
  160. "js": function () {
  161. "use strict";
  162. tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
  163. if (typeof tarteaucitron.user.ferankMore === 'function') {
  164. tarteaucitron.user.ferankMore();
  165. }
  166. });
  167. }
  168. };
  169. // ferank pub
  170. tarteaucitron.services.ferankpub = {
  171. "key": "ferankpub",
  172. "type": "ads",
  173. "name": "FERank",
  174. "uri": "https://www.ferank.fr/respect-vie-privee/#regiepublicitaire",
  175. "needConsent": false,
  176. "cookies": [],
  177. "js": function () {
  178. "use strict";
  179. tarteaucitron.addScript('//static.ferank.fr/publicite.async.js');
  180. },
  181. "fallback": function () {
  182. "use strict";
  183. var id = 'ferankpub';
  184. tarteaucitron.fallback(['ferank-publicite'], tarteaucitron.engage(id));
  185. }
  186. };
  187. // google+
  188. tarteaucitron.services.gplus = {
  189. "key": "gplus",
  190. "type": "social",
  191. "name": "Google+",
  192. "uri": "http://www.google.fr/intl/policies/privacy/",
  193. "needConsent": true,
  194. "cookies": [],
  195. "js": function () {
  196. "use strict";
  197. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  198. },
  199. "fallback": function () {
  200. "use strict";
  201. var id = 'gplus';
  202. tarteaucitron.fallback(['g-page', 'g-plus', 'g-plusone'], tarteaucitron.engage(id));
  203. }
  204. };
  205. // google adsense
  206. tarteaucitron.services.adsense = {
  207. "key": "adsense",
  208. "type": "ads",
  209. "name": "Adsense (Google)",
  210. "uri": "http://www.google.com/ads/preferences/",
  211. "needConsent": true,
  212. "cookies": [],
  213. "js": function () {
  214. "use strict";
  215. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  216. },
  217. "fallback": function () {
  218. "use strict";
  219. var id = 'adsense';
  220. tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
  221. }
  222. };
  223. // google analytics (old)
  224. tarteaucitron.services.gajs = {
  225. "key": "gajs",
  226. "type": "analytic",
  227. "name": "Google Analytics (ga.js)",
  228. "uri": "https://support.google.com/analytics/answer/6004245",
  229. "needConsent": true,
  230. "cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
  231. "js": function () {
  232. "use strict";
  233. window._gaq = window._gaq || [];
  234. window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]);
  235. window._gaq.push(['_trackPageview']);
  236. tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () {
  237. if (typeof tarteaucitron.user.gajsMore === 'function') {
  238. tarteaucitron.user.gajsMore();
  239. }
  240. });
  241. }
  242. };
  243. // google analytics
  244. tarteaucitron.services.analytics = {
  245. "key": "analytics",
  246. "type": "analytic",
  247. "name": "Google Analytics (universal)",
  248. "uri": "https://support.google.com/analytics/answer/6004245",
  249. "needConsent": true,
  250. "cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
  251. "js": function () {
  252. "use strict";
  253. window.GoogleAnalyticsObject = 'ga';
  254. window.ga = window.ga || function () {
  255. window.ga.q = window.ga.q || [];
  256. window.ga.q.push(arguments);
  257. };
  258. window.ga.l = new Date();
  259. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  260. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  261. ga('send', 'pageview');
  262. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  263. tarteaucitron.user.analyticsMore();
  264. }
  265. });
  266. }
  267. };
  268. // linkedin
  269. tarteaucitron.services.linkedin = {
  270. "key": "linkedin",
  271. "type": "social",
  272. "name": "Linkedin",
  273. "uri": "https://www.linkedin.com/legal/cookie_policy",
  274. "needConsent": true,
  275. "cookies": [],
  276. "js": function () {
  277. "use strict";
  278. tarteaucitron.fallback(['tacLinkedin'], '');
  279. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  280. },
  281. "fallback": function () {
  282. "use strict";
  283. var id = 'linkedin';
  284. tarteaucitron.fallback(['tacLinkedin'], tarteaucitron.engage(id));
  285. }
  286. };
  287. // pinterest
  288. tarteaucitron.services.pinterest = {
  289. "key": "pinterest",
  290. "type": "social",
  291. "name": "Pinterest",
  292. "uri": "https://about.pinterest.com/privacy-policy",
  293. "needConsent": true,
  294. "cookies": [],
  295. "js": function () {
  296. "use strict";
  297. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  298. }
  299. };
  300. // shareaholic
  301. tarteaucitron.services.shareaholic = {
  302. "key": "shareaholic",
  303. "type": "social",
  304. "name": "Shareaholic",
  305. "uri": "https://shareaholic.com/privacy/choices",
  306. "needConsent": true,
  307. "cookies": ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  308. "js": function () {
  309. "use strict";
  310. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  311. return;
  312. }
  313. tarteaucitron.fallback(['shareaholic-canvas'], '');
  314. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  315. try {
  316. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  317. } catch (e) {}
  318. });
  319. },
  320. "fallback": function () {
  321. "use strict";
  322. var id = 'shareaholic';
  323. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  324. }
  325. };
  326. // sharethis
  327. tarteaucitron.services.sharethis = {
  328. "key": "sharethis",
  329. "type": "social",
  330. "name": "ShareThis",
  331. "uri": "http://www.sharethis.com/legal/privacy/",
  332. "needConsent": true,
  333. "cookies": ['__unam'],
  334. "js": function () {
  335. "use strict";
  336. if (tarteaucitron.user.sharethisPublisher === undefined) {
  337. return;
  338. }
  339. var switchTo5x = true,
  340. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  341. tarteaucitron.fallback(['tacSharethis'], '');
  342. tarteaucitron.addScript(uri, '', function () {
  343. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  344. });
  345. },
  346. "fallback": function () {
  347. "use strict";
  348. var id = 'sharethis';
  349. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  350. }
  351. };
  352. // twitter
  353. tarteaucitron.services.twitter = {
  354. "key": "twitter",
  355. "type": "social",
  356. "name": "Twitter",
  357. "uri": "https://support.twitter.com/articles/20170514",
  358. "needConsent": true,
  359. "cookies": [],
  360. "js": function () {
  361. "use strict";
  362. tarteaucitron.fallback(['tacTwitter'], '');
  363. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  364. },
  365. "fallback": function () {
  366. "use strict";
  367. var id = 'twitter';
  368. tarteaucitron.fallback(['tacTwitter'], tarteaucitron.engage(id));
  369. }
  370. };
  371. // user voice
  372. tarteaucitron.services.uservoice = {
  373. "key": "uservoice",
  374. "type": "support",
  375. "name": "UserVoice",
  376. "uri": "https://www.uservoice.com/privacy/",
  377. "needConsent": true,
  378. "cookies": [],
  379. "js": function () {
  380. "use strict";
  381. if (tarteaucitron.user.userVoiceApi === undefined) {
  382. return;
  383. }
  384. tarteaucitron.addScript('//widget.uservoice.com/' + tarteaucitron.user.userVoiceApi + '.js');
  385. }
  386. };
  387. // vimeo
  388. tarteaucitron.services.vimeo = {
  389. "key": "vimeo",
  390. "type": "video",
  391. "name": "Vimeo",
  392. "uri": "http://vimeo.com/privacy",
  393. "needConsent": true,
  394. "cookies": ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'],
  395. "js": function () {
  396. "use strict";
  397. tarteaucitron.fallback(['vimeo_player'], function (x) {
  398. var video_id = x.getAttribute("videoID"),
  399. video_width = x.getAttribute("width"),
  400. frame_width = 'width=',
  401. video_height = x.getAttribute("height"),
  402. frame_height = 'height=',
  403. video_frame;
  404. if (video_id === undefined) {
  405. return "";
  406. }
  407. if (video_width !== undefined) {
  408. frame_width += '"' + video_width + '" ';
  409. } else {
  410. frame_width += '"" ';
  411. }
  412. if (video_height !== undefined) {
  413. frame_height += '"' + video_height + '" ';
  414. } else {
  415. frame_height += '"" ';
  416. }
  417. video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
  418. return video_frame;
  419. });
  420. },
  421. "fallback": function () {
  422. "use strict";
  423. var id = 'vimeo';
  424. tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id));
  425. }
  426. };
  427. // xiti
  428. tarteaucitron.services.xiti = {
  429. "key": "xiti",
  430. "type": "analytic",
  431. "name": "Xiti",
  432. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  433. "needConsent": true,
  434. "cookies": [],
  435. "js": function () {
  436. "use strict";
  437. if (tarteaucitron.user.xitiId === undefined) {
  438. return;
  439. }
  440. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  441. Xt_r,
  442. Xt_h,
  443. Xt_i,
  444. Xt_s,
  445. div = document.createElement('div');
  446. try {
  447. Xt_r = top.document.referrer;
  448. } catch (e) {
  449. Xt_r = document.referrer;
  450. }
  451. Xt_h = new Date();
  452. Xt_i = '<img style="display:none" border="0" alt="" ';
  453. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  454. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  455. if (parseFloat(navigator.appVersion) >= 4) {
  456. Xt_s = screen;
  457. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  458. }
  459. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  460. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  461. if (typeof tarteaucitron.user.xitiMore === 'function') {
  462. tarteaucitron.user.xitiMore();
  463. }
  464. }
  465. };
  466. // youtube
  467. tarteaucitron.services.youtube = {
  468. "key": "youtube",
  469. "type": "video",
  470. "name": "YouTube",
  471. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  472. "needConsent": true,
  473. "cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
  474. "js": function () {
  475. "use strict";
  476. tarteaucitron.fallback(['youtube_player'], function (x) {
  477. var video_id = x.getAttribute("videoID"),
  478. video_width = x.getAttribute("width"),
  479. frame_width = 'width=',
  480. video_height = x.getAttribute("height"),
  481. frame_height = 'height=',
  482. video_frame;
  483. if (video_id === undefined) {
  484. return "";
  485. }
  486. if (video_width !== undefined) {
  487. frame_width += '"' + video_width + '" ';
  488. } else {
  489. frame_width += '"" ';
  490. }
  491. if (video_height !== undefined) {
  492. frame_height += '"' + video_height + '" ';
  493. } else {
  494. frame_height += '"" ';
  495. }
  496. video_frame = '<iframe type="text/html" ' + frame_width + frame_height + ' src="//www.youtube.com/embed/' + video_id + ' " frameborder="0"></iframe>';
  497. return video_frame;
  498. });
  499. },
  500. "fallback": function () {
  501. "use strict";
  502. var id = 'youtube';
  503. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  504. }
  505. };
  506. // zopim
  507. tarteaucitron.services.zopim = {
  508. "key": "zopim",
  509. "type": "support",
  510. "name": "Zopim",
  511. "uri": "https://www.zopim.com/privacy",
  512. "needConsent": true,
  513. "cookies": ['__zlcid', '__zprivacy'],
  514. "js": function () {
  515. "use strict";
  516. if (tarteaucitron.user.zopimID === undefined) {
  517. return;
  518. }
  519. tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
  520. }
  521. };