tarteaucitron.services.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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. // jsapi
  269. tarteaucitron.services.jsapi = {
  270. "key": "jsapi",
  271. "type": "api",
  272. "name": "Google jsapi",
  273. "uri": "http://www.google.com/policies/privacy/",
  274. "needConsent": true,
  275. "cookies": [],
  276. "js": function () {
  277. "use strict";
  278. tarteaucitron.addScript('//www.google.com/jsapi');
  279. }
  280. };
  281. // linkedin
  282. tarteaucitron.services.linkedin = {
  283. "key": "linkedin",
  284. "type": "social",
  285. "name": "Linkedin",
  286. "uri": "https://www.linkedin.com/legal/cookie_policy",
  287. "needConsent": true,
  288. "cookies": [],
  289. "js": function () {
  290. "use strict";
  291. tarteaucitron.fallback(['tacLinkedin'], '');
  292. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  293. },
  294. "fallback": function () {
  295. "use strict";
  296. var id = 'linkedin';
  297. tarteaucitron.fallback(['tacLinkedin'], tarteaucitron.engage(id));
  298. }
  299. };
  300. // pinterest
  301. tarteaucitron.services.pinterest = {
  302. "key": "pinterest",
  303. "type": "social",
  304. "name": "Pinterest",
  305. "uri": "https://about.pinterest.com/privacy-policy",
  306. "needConsent": true,
  307. "cookies": [],
  308. "js": function () {
  309. "use strict";
  310. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  311. }
  312. };
  313. // shareaholic
  314. tarteaucitron.services.shareaholic = {
  315. "key": "shareaholic",
  316. "type": "social",
  317. "name": "Shareaholic",
  318. "uri": "https://shareaholic.com/privacy/choices",
  319. "needConsent": true,
  320. "cookies": ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  321. "js": function () {
  322. "use strict";
  323. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  324. return;
  325. }
  326. tarteaucitron.fallback(['shareaholic-canvas'], '');
  327. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  328. try {
  329. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  330. } catch (e) {}
  331. });
  332. },
  333. "fallback": function () {
  334. "use strict";
  335. var id = 'shareaholic';
  336. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  337. }
  338. };
  339. // sharethis
  340. tarteaucitron.services.sharethis = {
  341. "key": "sharethis",
  342. "type": "social",
  343. "name": "ShareThis",
  344. "uri": "http://www.sharethis.com/legal/privacy/",
  345. "needConsent": true,
  346. "cookies": ['__unam'],
  347. "js": function () {
  348. "use strict";
  349. if (tarteaucitron.user.sharethisPublisher === undefined) {
  350. return;
  351. }
  352. var switchTo5x = true,
  353. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  354. tarteaucitron.fallback(['tacSharethis'], '');
  355. tarteaucitron.addScript(uri, '', function () {
  356. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  357. });
  358. },
  359. "fallback": function () {
  360. "use strict";
  361. var id = 'sharethis';
  362. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  363. }
  364. };
  365. // twitter
  366. tarteaucitron.services.twitter = {
  367. "key": "twitter",
  368. "type": "social",
  369. "name": "Twitter",
  370. "uri": "https://support.twitter.com/articles/20170514",
  371. "needConsent": true,
  372. "cookies": [],
  373. "js": function () {
  374. "use strict";
  375. tarteaucitron.fallback(['tacTwitter'], '');
  376. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  377. },
  378. "fallback": function () {
  379. "use strict";
  380. var id = 'twitter';
  381. tarteaucitron.fallback(['tacTwitter'], tarteaucitron.engage(id));
  382. }
  383. };
  384. // user voice
  385. tarteaucitron.services.uservoice = {
  386. "key": "uservoice",
  387. "type": "support",
  388. "name": "UserVoice",
  389. "uri": "https://www.uservoice.com/privacy/",
  390. "needConsent": true,
  391. "cookies": [],
  392. "js": function () {
  393. "use strict";
  394. if (tarteaucitron.user.userVoiceApi === undefined) {
  395. return;
  396. }
  397. tarteaucitron.addScript('//widget.uservoice.com/' + tarteaucitron.user.userVoiceApi + '.js');
  398. }
  399. };
  400. // vimeo
  401. tarteaucitron.services.vimeo = {
  402. "key": "vimeo",
  403. "type": "video",
  404. "name": "Vimeo",
  405. "uri": "http://vimeo.com/privacy",
  406. "needConsent": true,
  407. "cookies": ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'],
  408. "js": function () {
  409. "use strict";
  410. tarteaucitron.fallback(['vimeo_player'], function (x) {
  411. var video_id = x.getAttribute("videoID"),
  412. video_width = x.getAttribute("width"),
  413. frame_width = 'width=',
  414. video_height = x.getAttribute("height"),
  415. frame_height = 'height=',
  416. video_frame;
  417. if (video_id === undefined) {
  418. return "";
  419. }
  420. if (video_width !== undefined) {
  421. frame_width += '"' + video_width + '" ';
  422. } else {
  423. frame_width += '"" ';
  424. }
  425. if (video_height !== undefined) {
  426. frame_height += '"' + video_height + '" ';
  427. } else {
  428. frame_height += '"" ';
  429. }
  430. video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
  431. return video_frame;
  432. });
  433. },
  434. "fallback": function () {
  435. "use strict";
  436. var id = 'vimeo';
  437. tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id));
  438. }
  439. };
  440. // xiti
  441. tarteaucitron.services.xiti = {
  442. "key": "xiti",
  443. "type": "analytic",
  444. "name": "Xiti",
  445. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  446. "needConsent": true,
  447. "cookies": [],
  448. "js": function () {
  449. "use strict";
  450. if (tarteaucitron.user.xitiId === undefined) {
  451. return;
  452. }
  453. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  454. Xt_r,
  455. Xt_h,
  456. Xt_i,
  457. Xt_s,
  458. div = document.createElement('div');
  459. try {
  460. Xt_r = top.document.referrer;
  461. } catch (e) {
  462. Xt_r = document.referrer;
  463. }
  464. Xt_h = new Date();
  465. Xt_i = '<img style="display:none" border="0" alt="" ';
  466. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  467. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  468. if (parseFloat(navigator.appVersion) >= 4) {
  469. Xt_s = screen;
  470. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  471. }
  472. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  473. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  474. if (typeof tarteaucitron.user.xitiMore === 'function') {
  475. tarteaucitron.user.xitiMore();
  476. }
  477. }
  478. };
  479. // youtube
  480. tarteaucitron.services.youtube = {
  481. "key": "youtube",
  482. "type": "video",
  483. "name": "YouTube",
  484. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  485. "needConsent": true,
  486. "cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
  487. "js": function () {
  488. "use strict";
  489. tarteaucitron.fallback(['youtube_player'], function (x) {
  490. var video_id = x.getAttribute("videoID"),
  491. video_width = x.getAttribute("width"),
  492. frame_width = 'width=',
  493. video_height = x.getAttribute("height"),
  494. frame_height = 'height=',
  495. video_frame;
  496. if (video_id === undefined) {
  497. return "";
  498. }
  499. if (video_width !== undefined) {
  500. frame_width += '"' + video_width + '" ';
  501. } else {
  502. frame_width += '"" ';
  503. }
  504. if (video_height !== undefined) {
  505. frame_height += '"' + video_height + '" ';
  506. } else {
  507. frame_height += '"" ';
  508. }
  509. video_frame = '<iframe type="text/html" ' + frame_width + frame_height + ' src="//www.youtube.com/embed/' + video_id + ' " frameborder="0"></iframe>';
  510. return video_frame;
  511. });
  512. },
  513. "fallback": function () {
  514. "use strict";
  515. var id = 'youtube';
  516. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  517. }
  518. };
  519. // zopim
  520. tarteaucitron.services.zopim = {
  521. "key": "zopim",
  522. "type": "support",
  523. "name": "Zopim",
  524. "uri": "https://www.zopim.com/privacy",
  525. "needConsent": true,
  526. "cookies": ['__zlcid', '__zprivacy'],
  527. "js": function () {
  528. "use strict";
  529. if (tarteaucitron.user.zopimID === undefined) {
  530. return;
  531. }
  532. tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
  533. }
  534. };