tarteaucitron.services.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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. // google+
  170. tarteaucitron.services.gplus = {
  171. "key": "gplus",
  172. "type": "social",
  173. "name": "Google+",
  174. "uri": "http://www.google.fr/intl/policies/privacy/",
  175. "needConsent": true,
  176. "cookies": [],
  177. "js": function () {
  178. "use strict";
  179. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  180. },
  181. "fallback": function () {
  182. "use strict";
  183. var id = 'gplus';
  184. tarteaucitron.fallback(['g-page', 'g-plus', 'g-plusone'], tarteaucitron.engage(id));
  185. }
  186. };
  187. // google adsense
  188. tarteaucitron.services.adsense = {
  189. "key": "adsense",
  190. "type": "ads",
  191. "name": "Adsense (Google)",
  192. "uri": "http://www.google.com/ads/preferences/",
  193. "needConsent": true,
  194. "cookies": [],
  195. "js": function () {
  196. "use strict";
  197. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  198. },
  199. "fallback": function () {
  200. "use strict";
  201. var id = 'adsense';
  202. tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
  203. }
  204. };
  205. // google analytics (old)
  206. tarteaucitron.services.gajs = {
  207. "key": "gajs",
  208. "type": "analytic",
  209. "name": "Google Analytics (ga.js)",
  210. "uri": "https://support.google.com/analytics/answer/6004245",
  211. "needConsent": true,
  212. "cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
  213. "js": function () {
  214. "use strict";
  215. window._gaq = window._gaq || [];
  216. window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]);
  217. window._gaq.push(['_trackPageview']);
  218. tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () {
  219. if (typeof tarteaucitron.user.gajsMore === 'function') {
  220. tarteaucitron.user.gajsMore();
  221. }
  222. });
  223. }
  224. };
  225. // google analytics
  226. tarteaucitron.services.analytics = {
  227. "key": "analytics",
  228. "type": "analytic",
  229. "name": "Google Analytics (universal)",
  230. "uri": "https://support.google.com/analytics/answer/6004245",
  231. "needConsent": true,
  232. "cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
  233. "js": function () {
  234. "use strict";
  235. window.GoogleAnalyticsObject = 'ga';
  236. window.ga = window.ga || function () {
  237. window.ga.q = window.ga.q || [];
  238. window.ga.q.push(arguments);
  239. };
  240. window.ga.l = new Date();
  241. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  242. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  243. ga('send', 'pageview');
  244. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  245. tarteaucitron.user.analyticsMore();
  246. }
  247. });
  248. }
  249. };
  250. // linkedin
  251. tarteaucitron.services.linkedin = {
  252. "key": "linkedin",
  253. "type": "social",
  254. "name": "Linkedin",
  255. "uri": "https://www.linkedin.com/legal/cookie_policy",
  256. "needConsent": true,
  257. "cookies": [],
  258. "js": function () {
  259. "use strict";
  260. tarteaucitron.fallback(['tacLinkedin'], '');
  261. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  262. },
  263. "fallback": function () {
  264. "use strict";
  265. var id = 'linkedin';
  266. tarteaucitron.fallback(['tacLinkedin'], tarteaucitron.engage(id));
  267. }
  268. };
  269. // pinterest
  270. tarteaucitron.services.pinterest = {
  271. "key": "pinterest",
  272. "type": "social",
  273. "name": "Pinterest",
  274. "uri": "https://about.pinterest.com/privacy-policy",
  275. "needConsent": true,
  276. "cookies": [],
  277. "js": function () {
  278. "use strict";
  279. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  280. }
  281. };
  282. // shareaholic
  283. tarteaucitron.services.shareaholic = {
  284. "key": "shareaholic",
  285. "type": "social",
  286. "name": "Shareaholic",
  287. "uri": "https://shareaholic.com/privacy/choices",
  288. "needConsent": true,
  289. "cookies": ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  290. "js": function () {
  291. "use strict";
  292. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  293. return;
  294. }
  295. tarteaucitron.fallback(['shareaholic-canvas'], '');
  296. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  297. try {
  298. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  299. } catch (e) {}
  300. });
  301. },
  302. "fallback": function () {
  303. "use strict";
  304. var id = 'shareaholic';
  305. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  306. }
  307. };
  308. // sharethis
  309. tarteaucitron.services.sharethis = {
  310. "key": "sharethis",
  311. "type": "social",
  312. "name": "ShareThis",
  313. "uri": "http://www.sharethis.com/legal/privacy/",
  314. "needConsent": true,
  315. "cookies": ['__unam'],
  316. "js": function () {
  317. "use strict";
  318. if (tarteaucitron.user.sharethisPublisher === undefined) {
  319. return;
  320. }
  321. var switchTo5x = true,
  322. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  323. tarteaucitron.fallback(['tacSharethis'], '');
  324. tarteaucitron.addScript(uri, '', function () {
  325. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  326. });
  327. },
  328. "fallback": function () {
  329. "use strict";
  330. var id = 'sharethis';
  331. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  332. }
  333. };
  334. // twitter
  335. tarteaucitron.services.twitter = {
  336. "key": "twitter",
  337. "type": "social",
  338. "name": "Twitter",
  339. "uri": "https://support.twitter.com/articles/20170514",
  340. "needConsent": true,
  341. "cookies": [],
  342. "js": function () {
  343. "use strict";
  344. tarteaucitron.fallback(['tacTwitter'], '');
  345. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  346. },
  347. "fallback": function () {
  348. "use strict";
  349. var id = 'twitter';
  350. tarteaucitron.fallback(['tacTwitter'], tarteaucitron.engage(id));
  351. }
  352. };
  353. // user voice
  354. tarteaucitron.services.uservoice = {
  355. "key": "uservoice",
  356. "type": "support",
  357. "name": "UserVoice",
  358. "uri": "https://www.uservoice.com/privacy/",
  359. "needConsent": true,
  360. "cookies": [],
  361. "js": function () {
  362. "use strict";
  363. if (tarteaucitron.user.userVoiceApi === undefined) {
  364. return;
  365. }
  366. window.UserVoice = window.UserVoice || [];
  367. tarteaucitron.addScript('//widget.uservoice.com/' + tarteaucitron.user.userVoiceApi + '.js', '', function () {
  368. UserVoice.push(['addTrigger', {
  369. mode: tarteaucitron.user.userVoiceMode,
  370. trigger_position: tarteaucitron.user.userVoicePosition,
  371. trigger_color: tarteaucitron.user.userVoiceColor,
  372. trigger_background_color: tarteaucitron.user.userVoiceBackground,
  373. accent_color: tarteaucitron.user.userVoiceAccent
  374. }]);
  375. if (typeof tarteaucitron.user.userVoiceMore === 'function') {
  376. tarteaucitron.user.userVoiceMore();
  377. }
  378. });
  379. }
  380. };
  381. // vimeo
  382. tarteaucitron.services.vimeo = {
  383. "key": "vimeo",
  384. "type": "video",
  385. "name": "Vimeo",
  386. "uri": "http://vimeo.com/privacy",
  387. "needConsent": true,
  388. "cookies": ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'],
  389. "js": function () {
  390. "use strict";
  391. tarteaucitron.fallback(['vimeo_player'], function (x) {
  392. var video_id = x.getAttribute("videoID"),
  393. video_width = x.getAttribute("width"),
  394. frame_width = 'width=',
  395. video_height = x.getAttribute("height"),
  396. frame_height = 'height=',
  397. video_frame;
  398. if (video_id === undefined) {
  399. return "";
  400. }
  401. if (video_width !== undefined) {
  402. frame_width += '"' + video_width + '" ';
  403. } else {
  404. frame_width += '"" ';
  405. }
  406. if (video_height !== undefined) {
  407. frame_height += '"' + video_height + '" ';
  408. } else {
  409. frame_height += '"" ';
  410. }
  411. video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
  412. return video_frame;
  413. });
  414. },
  415. "fallback": function () {
  416. "use strict";
  417. var id = 'vimeo';
  418. tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id));
  419. }
  420. };
  421. // xiti
  422. tarteaucitron.services.xiti = {
  423. "key": "xiti",
  424. "type": "analytic",
  425. "name": "Xiti",
  426. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  427. "needConsent": true,
  428. "cookies": [],
  429. "js": function () {
  430. "use strict";
  431. if (tarteaucitron.user.xitiId === undefined) {
  432. return;
  433. }
  434. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  435. Xt_r,
  436. Xt_h,
  437. Xt_i,
  438. Xt_s,
  439. div = document.createElement('div');
  440. try {
  441. Xt_r = top.document.referrer;
  442. } catch (e) {
  443. Xt_r = document.referrer;
  444. }
  445. Xt_h = new Date();
  446. Xt_i = '<img style="display:none" border="0" alt="" ';
  447. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  448. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  449. if (parseFloat(navigator.appVersion) >= 4) {
  450. Xt_s = screen;
  451. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  452. }
  453. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  454. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  455. if (typeof tarteaucitron.user.xitiMore === 'function') {
  456. tarteaucitron.user.xitiMore();
  457. }
  458. }
  459. };
  460. // youtube
  461. tarteaucitron.services.youtube = {
  462. "key": "youtube",
  463. "type": "video",
  464. "name": "YouTube",
  465. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  466. "needConsent": true,
  467. "cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
  468. "js": function () {
  469. "use strict";
  470. tarteaucitron.fallback(['youtube_player'], function (x) {
  471. var video_id = x.getAttribute("videoID"),
  472. video_width = x.getAttribute("width"),
  473. frame_width = 'width=',
  474. video_height = x.getAttribute("height"),
  475. frame_height = 'height=',
  476. video_frame;
  477. if (video_id === undefined) {
  478. return "";
  479. }
  480. if (video_width !== undefined) {
  481. frame_width += '"' + video_width + '" ';
  482. } else {
  483. frame_width += '"" ';
  484. }
  485. if (video_height !== undefined) {
  486. frame_height += '"' + video_height + '" ';
  487. } else {
  488. frame_height += '"" ';
  489. }
  490. video_frame = '<iframe type="text/html" ' + frame_width + frame_height + ' src="//www.youtube.com/embed/' + video_id + ' " frameborder="0"></iframe>';
  491. return video_frame;
  492. });
  493. },
  494. "fallback": function () {
  495. "use strict";
  496. var id = 'youtube';
  497. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  498. }
  499. };
  500. // zopim
  501. tarteaucitron.services.zopim = {
  502. "key": "zopim",
  503. "type": "support",
  504. "name": "Zopim",
  505. "uri": "https://www.zopim.com/privacy",
  506. "needConsent": true,
  507. "cookies": ['__zlcid', '__zprivacy'],
  508. "js": function () {
  509. "use strict";
  510. if (tarteaucitron.user.zopimID === undefined) {
  511. return;
  512. }
  513. tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
  514. }
  515. };