Skip to content

Commit

Permalink
Fix SID tracking for funded learning applications
Browse files Browse the repository at this point in the history
  • Loading branch information
haron1100 authored Sep 18, 2024
1 parent 23c23af commit 73833ba
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ function uuidv4() {
acquisition_channel: urlParams.get("aq_c"),
affiliate: urlParams.get("aff"),
referral: urlParams.get("referral"),
li_fat_id: urlParams.get("li_fat_id"),
country: localStorage.getItem('country'),
countryCode: localStorage.getItem("countryCode"),
li_fat_id: urlParams.get("li_fat_id"),
country: localStorage.getItem('country'),
countryCode: localStorage.getItem("countryCode"),
currencyCode: localStorage.getItem("currencyCode"),
region: localStorage.getItem("region")
};
Expand Down Expand Up @@ -416,7 +416,7 @@ function uuidv4() {
value = 172.06;
}

if(window.aiCoreParams.gclid){
if(window.aiCoreParams.gclid){
value = value*1.3
}else if(window.aiCoreParams.fbclid){
value = value*0.5;
Expand Down Expand Up @@ -707,24 +707,24 @@ function uuidv4() {
}

async function injectSkbTypeform() {
let form_container = document.querySelector(".bootcamp-eligibility-typeform-container");
let url = window.location.href;
let split_on_hash = url.split("#");
if (split_on_hash.length > 1) hidden_fields = split_on_hash[split_on_hash.length - 1];


setTimeout(()=>{
//console.log('adding quiz', window.aiCoreParams)
// add variables to typeform url
//let cs_map = {"GBP":"£", "EUR":"€", "USD":"$"}
//let cs = cs_map[window.aiCoreParams.currencyCode] || "$"
//form_container.innerHTML += `<div data-tf-disable-auto-focus data-tf-opacity="0" data-tf-widget="HVqGnkwK" data-tf-iframe-props="title=Personalised learning path" data-tf-medium="snippet" data-tf-hidden="sid=${window.aiCoreParams.sid},gclid=${window.aiCoreParams.gclid},fbclid=${window.aiCoreParams.fbc},referral=${window.aiCoreParams.referral},fbp=${window.aiCoreParams.fbp},affiliate=${window.aiCoreParams.affiliate},li_fat_id=${window.aiCoreParams.li_fat_id},country=${window.aiCoreParams.country},currency=${window.aiCoreParams.currencyCode},currency_symbol=${cs}" style="width:100%;height:100%;"></div>`
form_container.innerHTML += `<div data-tf-live="01J4KEYWGD71WMDM2E8HEV3YQR" data-tf-hidden="sid=${window.aiCoreParams.sid},country=${window.aiCoreParams.country}"></div>`
var s = document.createElement( 'script' );
s.setAttribute( 'src', "//embed.typeform.com/next/embed.js");
document.body.appendChild( s );
}, 500)
}

async function injectAfaTypeform() {

setTimeout(()=>{
form_container.innerHTML += `<div data-tf-live="01J6VM8RNPARBGTGAVECYDJ3PS" data-tf-hidden="sid=${window.aiCoreParams.sid},country=${window.aiCoreParams.country}"></div>`
var s = document.createElement( 'script' );
s.setAttribute( 'src', "//embed.typeform.com/next/embed.js");
document.body.appendChild( s );
}, 500)
}

return {
toggleModal
Expand Down

0 comments on commit 73833ba

Please sign in to comment.