Advertisement
Dzhubal

Untitled

Sep 29th, 2019
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var clientid = yaCounter99999.getClientID(); //99999 поменять на реальный номер счетчика метрики
  2. carrotquest.identify([{op: 'set_once', key: 'yclid', value: 'yclid'+clientid}]);
  3.  
  4. function getGCid() {
  5.     var match = document.cookie.match('(?:^|;)\\s*_ga=([^;]*)');
  6.     var raw = (match) ? decodeURIComponent(match[1]) : null;
  7.     if (raw) {
  8.         match = raw.match(/(\d+\.\d+)$/);
  9.     }
  10.     var gacid = (match) ? match[1] : null;
  11.     if (gacid) {
  12.         carrotquest.identify([{op: 'set_once', key: 'cid', value: gacid}]);
  13.     }
  14. };
  15. getGCid();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement