Advertisement
Dzhubal

Untitled

Dec 10th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function TrackUtm(){
  2.     var utm_sorce = window.location.href.match(/utm_source=([^&]+)/);
  3.     var utm_medium = window.location.href.match(/utm_medium=([^&]+)/);
  4.     var utm_campaign = window.location.href.match(/utm_campaign=([^&]+)/);
  5.     var utm_term = window.location.href.match(/utm_term=([^&]+)/);
  6.     var utm_content = window.location.href.match(/utm_content=([^&]+)/);
  7.     var utm_email = window.location.href.match(/utm_email=([^&]+)/);
  8.     if (utm_content != undefined) {
  9.         carrotquest.identify({ 'Последняя метка UTM Content': utm_content[1] });
  10.     };
  11.     if (utm_sorce != undefined) {
  12.         carrotquest.identify({ 'Последняя метка UTM Source': utm_sorce[1] });
  13.     };
  14.     if (utm_medium != undefined) {
  15.         carrotquest.identify({ 'Последняя метка UTM Medium': utm_medium[1] });
  16.     };
  17.     if (utm_campaign != undefined) {
  18.         carrotquest.identify({ 'Последняя метка UTM Campaign': utm_campaign[1] });
  19.     };
  20.     if (utm_term != undefined) {
  21.         carrotquest.identify({ 'Последняя метка UTM Term': utm_term[1] });
  22.     };
  23.     if (utm_email != undefined) {
  24.         carrotquest.identify({ '$email': utm_email[1] });
  25.     };
  26. };
  27. TrackUtm();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement