tarteaucitron.services.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  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. "js": function () {
  11. "use strict";
  12. if (tarteaucitron.user.addthisPubId === undefined) {
  13. return;
  14. }
  15. tarteaucitron.fallback(['addthis_sharing_toolbox'], '');
  16. tarteaucitron.addScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=' + tarteaucitron.user.addthisPubId);
  17. },
  18. "fallback": function () {
  19. "use strict";
  20. var cookies = ['__atuvc', '__atuvs'],
  21. id = 'addthis';
  22. tarteaucitron.cookie.purge(cookies);
  23. tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id));
  24. }
  25. };
  26. // alexa
  27. tarteaucitron.services.alexa = {
  28. "key": "alexa",
  29. "type": "analytics",
  30. "name": "Alexa",
  31. "uri": "http://www.alexa.com/help/privacy",
  32. "needConsent": true,
  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. "fallback": function () {
  46. "use strict";
  47. var cookies = ['__asc', '__auc'];
  48. tarteaucitron.cookie.purge(cookies);
  49. }
  50. };
  51. // clicky
  52. tarteaucitron.services.clicky = {
  53. "key": "clicky",
  54. "type": "analytics",
  55. "name": "Clicky",
  56. "uri": "https://clicky.com/terms",
  57. "needConsent": true,
  58. "js": function () {
  59. "use strict";
  60. if (tarteaucitron.user.clickyId === undefined) {
  61. return;
  62. }
  63. tarteaucitron.addScript('//static.getclicky.com/js', '', function () {
  64. if (typeof clicky.init === 'function') {
  65. clicky.init(tarteaucitron.user.clickyId);
  66. }
  67. if (typeof tarteaucitron.user.clickyMore === 'function') {
  68. tarteaucitron.user.clickyMore();
  69. }
  70. });
  71. },
  72. "fallback": function () {
  73. "use strict";
  74. var 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];
  75. tarteaucitron.cookie.purge(cookies);
  76. }
  77. };
  78. // disqus
  79. tarteaucitron.services.disqus = {
  80. "key": "disqus",
  81. "type": "social",
  82. "name": "Disqus",
  83. "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
  84. "needConsent": true,
  85. "js": function () {
  86. "use strict";
  87. if (tarteaucitron.user.disqusShortname === undefined) {
  88. return;
  89. }
  90. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js');
  91. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js');
  92. },
  93. "fallback": function () {
  94. "use strict";
  95. var id = 'disqus';
  96. if (document.getElementById('disqus_thread')) {
  97. document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
  98. }
  99. }
  100. };
  101. // facebook
  102. tarteaucitron.services.facebook = {
  103. "key": "facebook",
  104. "type": "social",
  105. "name": "Facebook",
  106. "uri": "https://www.facebook.com/help/cookies/",
  107. "needConsent": true,
  108. "js": function () {
  109. "use strict";
  110. tarteaucitron.fallback(['fb-like'], '');
  111. tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
  112. },
  113. "fallback": function () {
  114. "use strict";
  115. tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-comments', 'fb-activity', 'fb-like-box', 'fb-send', 'fb-share-button', 'fb-like'], '<a href="https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_facebook">Facebook</a>');
  116. }
  117. };
  118. // ferank
  119. tarteaucitron.services.ferank = {
  120. "key": "ferank",
  121. "type": "analytics",
  122. "name": "FERank",
  123. "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
  124. "needConsent": false,
  125. "js": function () {
  126. "use strict";
  127. tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
  128. if (typeof tarteaucitron.user.ferankMore === 'function') {
  129. tarteaucitron.user.ferankMore();
  130. }
  131. });
  132. }
  133. };
  134. // google+
  135. tarteaucitron.services.gplus = {
  136. "key": "gplus",
  137. "type": "social",
  138. "name": "Google+",
  139. "uri": "http://www.google.fr/intl/policies/privacy/",
  140. "needConsent": true,
  141. "js": function () {
  142. "use strict";
  143. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  144. },
  145. "fallback": function () {
  146. "use strict";
  147. tarteaucitron.fallback(['g-page', 'g-plus', 'g-plusone'], '<a href="https://plus.google.com/share?url=' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_googlep">Google+</a>');
  148. }
  149. };
  150. // google adsense
  151. tarteaucitron.services.adsense = {
  152. "key": "adsense",
  153. "type": "ads",
  154. "name": "Adsense (Google)",
  155. "uri": "http://www.google.com/ads/preferences/",
  156. "needConsent": true,
  157. "js": function () {
  158. "use strict";
  159. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  160. },
  161. "fallback": function () {
  162. "use strict";
  163. var id = 'adsense';
  164. tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
  165. }
  166. };
  167. // google analytics (old)
  168. tarteaucitron.services.gajs = {
  169. "key": "gajs",
  170. "type": "analytics",
  171. "name": "Google Analytics (ga.js)",
  172. "uri": "https://support.google.com/analytics/answer/6004245",
  173. "needConsent": true,
  174. "js": function () {
  175. "use strict";
  176. window._gaq = window._gaq || [];
  177. window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]);
  178. window._gaq.push(['_trackPageview']);
  179. tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () {
  180. if (typeof tarteaucitron.user.gajsMore === 'function') {
  181. tarteaucitron.user.gajsMore();
  182. }
  183. });
  184. },
  185. "fallback": function () {
  186. "use strict";
  187. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  188. tarteaucitron.cookie.purge(cookies);
  189. }
  190. };
  191. // google analytics
  192. tarteaucitron.services.analytics = {
  193. "key": "analytics",
  194. "type": "analytics",
  195. "name": "Google Analytics (universal)",
  196. "uri": "https://support.google.com/analytics/answer/6004245",
  197. "needConsent": true,
  198. "js": function () {
  199. "use strict";
  200. window.GoogleAnalyticsObject = 'ga';
  201. window.ga = window.ga || function () {
  202. window.ga.q = window.ga.q || [];
  203. window.ga.q.push(arguments);
  204. };
  205. window.ga.l = new Date();
  206. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  207. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  208. ga('send', 'pageview');
  209. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  210. tarteaucitron.user.analyticsMore();
  211. }
  212. });
  213. },
  214. "grayJs": function () {
  215. "use strict";
  216. window.GoogleAnalyticsObject = 'ga';
  217. window.ga = window.ga || function () {
  218. window.ga.q = window.ga.q || [];
  219. window.ga.q.push(arguments);
  220. };
  221. window.ga.l = new Date();
  222. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  223. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 86400});
  224. ga('set', 'anonymizeIp', true);
  225. ga('set', 'forceSSL', true);
  226. ga('send', 'pageview');
  227. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  228. tarteaucitron.user.analyticsMore();
  229. }
  230. });
  231. },
  232. "fallback": function () {
  233. "use strict";
  234. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  235. tarteaucitron.cookie.purge(cookies);
  236. }
  237. };
  238. // linkedin
  239. tarteaucitron.services.linkedin = {
  240. "key": "linkedin",
  241. "type": "social",
  242. "name": "Linkedin",
  243. "uri": "https://www.linkedin.com/legal/cookie_policy",
  244. "needConsent": true,
  245. "js": function () {
  246. "use strict";
  247. tarteaucitron.fallback(['tacLinkedin'], '');
  248. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  249. },
  250. "fallback": function () {
  251. "use strict";
  252. tarteaucitron.fallback(['tacLinkedin'], '<a href="http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_linkedin">Linkedin</a>');
  253. }
  254. };
  255. // pinterest
  256. tarteaucitron.services.pinterest = {
  257. "key": "pinterest",
  258. "type": "social",
  259. "name": "Pinterest",
  260. "uri": "https://about.pinterest.com/privacy-policy",
  261. "needConsent": true,
  262. "js": function () {
  263. "use strict";
  264. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  265. }
  266. };
  267. // shareaholic
  268. tarteaucitron.services.shareaholic = {
  269. "key": "shareaholic",
  270. "type": "social",
  271. "name": "Shareaholic",
  272. "uri": "https://shareaholic.com/privacy/choices",
  273. "needConsent": true,
  274. "js": function () {
  275. "use strict";
  276. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  277. return;
  278. }
  279. tarteaucitron.fallback(['shareaholic-canvas'], '');
  280. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  281. try {
  282. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  283. } catch (e) {}
  284. });
  285. },
  286. "fallback": function () {
  287. "use strict";
  288. var cookies = ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  289. id = 'shareaholic';
  290. tarteaucitron.cookie.purge(cookies);
  291. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  292. }
  293. };
  294. // sharethis
  295. tarteaucitron.services.sharethis = {
  296. "key": "sharethis",
  297. "type": "social",
  298. "name": "ShareThis",
  299. "uri": "http://www.sharethis.com/legal/privacy/",
  300. "needConsent": true,
  301. "js": function () {
  302. "use strict";
  303. if (tarteaucitron.user.sharethisPublisher === undefined) {
  304. return;
  305. }
  306. var switchTo5x = true,
  307. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  308. tarteaucitron.fallback(['tacSharethis'], '');
  309. tarteaucitron.addScript(uri, '', function () {
  310. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  311. });
  312. },
  313. "fallback": function () {
  314. "use strict";
  315. var cookies = ['__unam'],
  316. id = 'sharethis';
  317. tarteaucitron.cookie.purge(cookies);
  318. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  319. }
  320. };
  321. // twitter
  322. tarteaucitron.services.twitter = {
  323. "key": "twitter",
  324. "type": "social",
  325. "name": "Twitter",
  326. "uri": "https://support.twitter.com/articles/20170514",
  327. "needConsent": true,
  328. "js": function () {
  329. "use strict";
  330. tarteaucitron.fallback(['tacTwitter'], '');
  331. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  332. },
  333. "fallback": function () {
  334. "use strict";
  335. tarteaucitron.fallback(['tacTwitter'], '<a href="https://twitter.com/intent/tweet?text=' + encodeURIComponent(document.title) + '%20' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_twitter">Twitter</a>');
  336. }
  337. };
  338. // youtube
  339. tarteaucitron.services.youtube = {
  340. "key": "youtube",
  341. "type": "social",
  342. "name": "YouTube",
  343. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  344. "needConsent": true,
  345. "js": function () {
  346. "use strict";
  347. tarteaucitron.fallback(['youtube_player'], function (x) {
  348. var video_id = x.getAttribute("videoID"),
  349. video_width = x.getAttribute("width"),
  350. frame_width = 'width=',
  351. video_height = x.getAttribute("height"),
  352. frame_height = 'height=',
  353. video_frame;
  354. if (video_id === undefined) {
  355. return "";
  356. }
  357. if (video_width !== undefined) {
  358. frame_width += '"' + video_width + '" ';
  359. } else {
  360. frame_width += '"" ';
  361. }
  362. if (video_height !== undefined) {
  363. frame_height += '"' + video_height + '" ';
  364. } else {
  365. frame_height += '"" ';
  366. }
  367. video_frame = '<iframe id="ytplayer" type="text/html" ' + frame_width + frame_height + '" src="//www.youtube.com/embed/' + video_id + ' " frameborder="0" />';
  368. return video_frame;
  369. });
  370. },
  371. "fallback": function () {
  372. "use strict";
  373. var cookies = ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
  374. id = 'youtube';
  375. tarteaucitron.cookie.purge(cookies);
  376. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  377. }
  378. };
  379. // xiti
  380. tarteaucitron.services.xiti = {
  381. "key": "xiti",
  382. "type": "analytics",
  383. "name": "Xiti",
  384. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  385. "needConsent": true,
  386. "js": function () {
  387. "use strict";
  388. if (tarteaucitron.user.xitiId === undefined) {
  389. return;
  390. }
  391. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  392. Xt_r,
  393. Xt_h,
  394. Xt_i,
  395. Xt_s,
  396. div = document.createElement('div');
  397. try {
  398. Xt_r = top.document.referrer;
  399. } catch (e) {
  400. Xt_r = document.referrer;
  401. }
  402. Xt_h = new Date();
  403. Xt_i = '<img style="display:none" border="0" alt="" ';
  404. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  405. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  406. if (parseFloat(navigator.appVersion) >= 4) {
  407. Xt_s = screen;
  408. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  409. }
  410. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  411. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  412. if (typeof tarteaucitron.user.xitiMore === 'function') {
  413. tarteaucitron.user.xitiMore();
  414. }
  415. },
  416. "fallback": function () {
  417. "use strict";
  418. var cookies = [''];
  419. tarteaucitron.cookie.purge(cookies);
  420. }
  421. };
  422. // zopim
  423. tarteaucitron.services.zopim = {
  424. "key": "zopim",
  425. "type": "social",
  426. "name": "Zopim",
  427. "uri": "https://www.zopim.com/privacy",
  428. "needConsent": true,
  429. "js": function () {
  430. "use strict";
  431. if (tarteaucitron.user.zopimID === undefined) {
  432. return;
  433. }
  434. tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
  435. },
  436. "fallback": function () {
  437. "use strict";
  438. var cookies = ['__zlcid', '__zprivacy'];
  439. tarteaucitron.cookie.purge(cookies);
  440. }
  441. };