tarteaucitron.services.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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": "analytics",
  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": "analytics",
  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": "social",
  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": "social",
  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": "analytics",
  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": "analytics",
  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": "analytics",
  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. // vimeo
  354. tarteaucitron.services.vimeo = {
  355. "key": "vimeo",
  356. "type": "social",
  357. "name": "Vimeo",
  358. "uri": "http://vimeo.com/privacy",
  359. "needConsent": true,
  360. "cookies": ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'],
  361. "js": function () {
  362. "use strict";
  363. tarteaucitron.fallback(['vimeo_player'], function (x) {
  364. var video_id = x.getAttribute("videoID"),
  365. video_width = x.getAttribute("width"),
  366. frame_width = 'width=',
  367. video_height = x.getAttribute("height"),
  368. frame_height = 'height=',
  369. video_frame;
  370. if (video_id === undefined) {
  371. return "";
  372. }
  373. if (video_width !== undefined) {
  374. frame_width += '"' + video_width + '" ';
  375. } else {
  376. frame_width += '"" ';
  377. }
  378. if (video_height !== undefined) {
  379. frame_height += '"' + video_height + '" ';
  380. } else {
  381. frame_height += '"" ';
  382. }
  383. video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
  384. return video_frame;
  385. });
  386. },
  387. "fallback": function () {
  388. "use strict";
  389. var id = 'vimeo';
  390. tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id));
  391. }
  392. };
  393. // xiti
  394. tarteaucitron.services.xiti = {
  395. "key": "xiti",
  396. "type": "analytics",
  397. "name": "Xiti",
  398. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  399. "needConsent": true,
  400. "cookies": [],
  401. "js": function () {
  402. "use strict";
  403. if (tarteaucitron.user.xitiId === undefined) {
  404. return;
  405. }
  406. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  407. Xt_r,
  408. Xt_h,
  409. Xt_i,
  410. Xt_s,
  411. div = document.createElement('div');
  412. try {
  413. Xt_r = top.document.referrer;
  414. } catch (e) {
  415. Xt_r = document.referrer;
  416. }
  417. Xt_h = new Date();
  418. Xt_i = '<img style="display:none" border="0" alt="" ';
  419. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  420. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  421. if (parseFloat(navigator.appVersion) >= 4) {
  422. Xt_s = screen;
  423. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  424. }
  425. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  426. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  427. if (typeof tarteaucitron.user.xitiMore === 'function') {
  428. tarteaucitron.user.xitiMore();
  429. }
  430. }
  431. };
  432. // youtube
  433. tarteaucitron.services.youtube = {
  434. "key": "youtube",
  435. "type": "social",
  436. "name": "YouTube",
  437. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  438. "needConsent": true,
  439. "cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
  440. "js": function () {
  441. "use strict";
  442. tarteaucitron.fallback(['youtube_player'], function (x) {
  443. var video_id = x.getAttribute("videoID"),
  444. video_width = x.getAttribute("width"),
  445. frame_width = 'width=',
  446. video_height = x.getAttribute("height"),
  447. frame_height = 'height=',
  448. video_frame;
  449. if (video_id === undefined) {
  450. return "";
  451. }
  452. if (video_width !== undefined) {
  453. frame_width += '"' + video_width + '" ';
  454. } else {
  455. frame_width += '"" ';
  456. }
  457. if (video_height !== undefined) {
  458. frame_height += '"' + video_height + '" ';
  459. } else {
  460. frame_height += '"" ';
  461. }
  462. video_frame = '<iframe type="text/html" ' + frame_width + frame_height + ' src="//www.youtube.com/embed/' + video_id + ' " frameborder="0"></iframe>';
  463. return video_frame;
  464. });
  465. },
  466. "fallback": function () {
  467. "use strict";
  468. var id = 'youtube';
  469. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  470. }
  471. };
  472. // zopim
  473. tarteaucitron.services.zopim = {
  474. "key": "zopim",
  475. "type": "social",
  476. "name": "Zopim",
  477. "uri": "https://www.zopim.com/privacy",
  478. "needConsent": true,
  479. "cookies": ['__zlcid', '__zprivacy'],
  480. "js": function () {
  481. "use strict";
  482. if (tarteaucitron.user.zopimID === undefined) {
  483. return;
  484. }
  485. tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
  486. }
  487. };