RedTrack and Ringba: a workaround for tracking

Call tracking services are becoming more and more popular every day. More and more people want to know how to connect it to their tracking system, as it is important to know what is converting. Although in RedTrack, we are not call tracking and Ringba, in particular, experts, we found a way to track.
Here we go!

  1. To make the suggested workaround work, you need to have a landing page.
    Add a universal tracking script to that page and set the tracking on the traffic channel side.

  2. Now go to Ringba. Copy and save the publisher id from Ringba. Follow Ringba’s guide, step 2.
    You need an ID that is a part of the URL between “…enrich/” and “?”

  3. Add this script to the page in the head:

<script>
function getCookie(name) {
  var value = "; " + document.cookie;
  var parts = value.split("; " + name + "=");
  if (parts.length >= 2) return parts.pop().split(";").shift();
}
function getCookieOnLoad(name) {
  var clickId = getCookie(name);
  if(!clickId || clickId === 'undefined') {
    setTimeout(function() {
      getCookieOnLoad(name);
    }, 1000);
    return;
  }
}

var publisherNumber = "1111111111111111";
var clickId = getCookieOnLoad('rtkclickid-store');
var phone = "";
console.log(window.ringba_known_numbers);
var arPhones = [];
var links = document.getElementsByTagName("a");
for(var i = 0; i < links.length; i++) {
    if(links[i].href && links[i].href.startsWith("tel:")) {
		arPhones.push(links[i].href.toString().replace("tel:", ""));
	}
}
if(arPhones.length !== 0) {
	phone = arPhones[0];
}

if(phone && clickId) {
	phone = phone.replace(/\D/g, '');
    try {
        phone = Number(phone);
    } catch (e) {
        //
    }
	setTimeout(() => {
		fetch(`https://display.ringba.com/enrich/${publisherNumber}?callerid=${phone}&clickid=${clickId}`) 
			.then(res => console.log(res.json())); 
	}, 2000);
}  
</script>
  1. publisherNumber = “1111111111111111” variable needs to be changed.
    Replace 1111111111111111 with the actual publisher ID you copied and saved within the point 2.