Typeform and RedTrack
Typeform is a web-based platform you can use to create anything from surveys to apps, without writing a single line of code.
Setup in Typeform
1. Add the rtclickid parameter to Typeform
1.1 Go to your Typeform profile → Create typeform:
1.2 Create → Logic → Personalize with data → Hidden fields:
1.3 Add new field → give these fields names rtclickid and contact_type → Save to apply the changes:
2. Add Webhook to Typeform
2.1 In your Typeform template go to the tab Connect → Webhooks → Add a webhook:
2.2 Insert the URL for your Webhook→ Save webhook:
– instead of yourdomain.rdtk.io you put RT’s default subdomain which can be found in Tools→Domains→Create new domain:
– your API key can be found in RedTrack→Tools→Integrations→General:
Setup in RedTrack
1. Add custom tracking domain
2. Set up conversion tracking
So far, the only Typeform event that can be added to RedTrack is Lead. To set it up go to Tools → Conversion tracking → Conversion type → name the event Lead:
3. Add your Brand and Website (for Advertisers) / Offer source and Offer (for Affiliates)
*Phone
4. Create a paid traffic campaign
– Affiliates should add the campaign for the unattributed (organic) traffic as per this guide.
To create a campaign for the paid traffic follow these simple steps:
- Add the Traffic channel. Most of them have a preset template in RedTrack.
- Launch a campaign for the paid Traffic channel. Your website/shop will be the main link added to the traffic channel. Be guided by this article for Advertisers / this one for Affiliates.
GTM setup
* For Affiliates: use this guide to help you with the universal tracking script.
* For Advertisers: a universal tracking script was created automatically once you had added your Website.
Both Affiliates and Advertisers can find the generated universal tracking script in Tools → Scripts:
1. Adjust the settings in GTM
1.1 Follow this guide on how to integrate Google Tag Manager (GTM) with RedTrack.
1.2 In GTM settings Create 3 types of Tags:
Essential elements:
- Tag = Custom HTML
- Triggering = All Pages (Page view)
Script:
Use the universal tracking script for this.
Essential elements:
- Type= Custom HTML
- Triggering= All Elements (All Clicks)
Script:
<script>
function setFormClickIdValue(clickid) {
var currentUrl = new URL(window.location.href);
currentUrl.searchParams.set('rtclickid', clickid)
currentUrl.searchParams.set('contact_type', 'lead')
var pageviewCount = getCookie("pageviewCount");
console.log(currentUrl.href,window.location.href,pageviewCount);
if (typeof pageviewCount === "undefined" || parseInt(pageviewCount) < 2) {
window.location.href = currentUrl.href
}
if (!window.location.href.includes('rtclickid')) {
var currentUrl = new URL(window.location.href);
currentUrl.searchParams.set('rtclickid', clickid)
currentUrl.searchParams.set('contact_type', 'lead')
window.location.href = currentUrl.href
}
}
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
if (getCookie('rtkclickid-store') !== null && getCookie('rtkclickid-store') !== undefined && getCookie('rtkclickid-store') !== 'undefined') {
setTimeout(function(){
setFormClickIdValue(getCookie('rtkclickid-store'))
}, 100)
}
</script>
Essential elements:
- Type= Custom HTML
- Triggering= Initialization (All Pages)
Script:
<script type="text/javascript">
var pageviewCount = getCookie("pageviewCount");
if (typeof pageviewCount === "undefined") {
pageviewCount = 1;
} else {
pageviewCount++;
}
setCookie("pageviewCount", pageviewCount, 30);
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
if (getCookie('rtkclickid-store') !== null && getCookie('rtkclickid-store') !== undefined && getCookie('rtkclickid-store') !== 'undefined') {
setTimeout(function(){
setFormClickIdValue(getCookie('rtkclickid-store'))
}, 100)
}
function setCookie(name, value, expires) {
var cookie = name + "=" + value + "; path=/; domain=." + location.hostname.replace(/^www\./i, "");
if (typeof expires !== "undefined") {
var now = new Date();
now.setTime(now.getTime() + expires * 24 * 60 * 60 * 1000);
cookie += "; expires=" + now.toUTCString();
}
document.cookie = cookie;
}
</script>
2. Connect GTM to Typeform
2.1 Copy your Google Tag Manager Container ID.
2.2 Go to your Typeform account → open the needed form → activate the tab Connect → Integrations → find Google Tag Manager → Connect:
2.3 Paste the GTM number to the popped-up form → Save: