Home >
Paid Traffic Sources >
Facebook & Instagram
HELP: I duno how to code (12)
07-30-2021 08:34 PM
#1
schlossy (Member)
HELP: I duno how to code
Hi Friends!
i need a javascript code on my website which passes the FBCLID from:
1. the people who click onto my website from facebook
to
2. the people who click on button on my website to another website link (also referred to as Everflow links)
The following is a more detailed explanation:
''IMPORTANT: If you are hosting your own presell pages where shoppers click out to Everflow links, you will need to pass the FBCLID from Facebook into Everflow links in order for CAPI to work properly.
For example:
1. Shopper clicks on a Facebook Ad and lands on - https://coolstuff.com/product?fbclid=1234 (the FBCLID is automatically added by FB)
2. You would then need to write a script that reads “fbclid=1234” from the original URL and inserts it into the Everflow link - https://deals.getproduct.io/ABC123/?altdomain=product-coolstuff.com&gupix=fb.1234567890&fbclid=1234
This FBCLID is the primary identifier that Facebook uses to associate events back to your ads.The easiest solution would be to add a javascript snippet to the presell page that parses the current browser URL query string (reads what's in the query string), extracts the URL parameters and then modifies the Everflow tracking links on the page to re-append the parsed query string (adds the query string to the Everflow URL).This is something a 3rd party developer should be able to assist with if needed.''
Does anyone have such a script that i can add to my lander? I am using clickfunnels
So Thankful if anyone could help!!!
07-31-2021 05:49 AM
#2
schlossy (Member)
sorry thread closed as I have found the solution. 
08-03-2021 10:35 PM
#3
jeremie (Moderator)
You can post the solution here if you want, so that others can benefit from it, or help you improve it :-)
08-03-2021 10:54 PM
#4
ScottyG (Senior Member)

Originally Posted by
jeremie
You can post the solution here if you want, so that others can benefit from it, or help you improve it :-)
My solution:
<script>
function getURLParameter(name) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] === name) {
return pair[1];
}
}
return "";
}
function go_away () {
location.href = "https://yoururlhere.com/lander?fbclid=" + getURLParameter('fbclid');
}
window.onload = function () {
for ( let link of document.querySelectorAll('a') ) {
let href = "https://yoururlhere.com/lander?fbclid=" + getURLParameter('fbclid');
link.setAttribute('href', href);
}
}
</script>
Replace your url in there and it'll automatically fix every link on page load.
08-04-2021 03:54 AM
#5
schlossy (Member)
Thanks Scotty, yes it is pretty much this.

Originally Posted by
ScottyG
My solution:
<script>
function getURLParameter(name) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] === name) {
return pair[1];
}
}
return "";
}
function go_away () {
location.href = "https://yoururlhere.com/lander?fbclid=" + getURLParameter('fbclid');
}
window.onload = function () {
for ( let link of document.querySelectorAll('a') ) {
let href = "https://yoururlhere.com/lander?fbclid=" + getURLParameter('fbclid');
link.setAttribute('href', href);
}
}
</script>
Replace your url in there and it'll automatically fix every link on page load.
03-02-2022 11:09 PM
#6
asharjamil (Member)

Originally Posted by
schlossy
Hi Friends!
i need a javascript code on my website which passes the FBCLID from:
1. the people who click onto my website from facebook
to
2. the people who click on button on my website to another website link (also referred to as Everflow links)
The following is a more detailed explanation:
''IMPORTANT: If you are hosting your own presell pages where shoppers click out to Everflow links, you will need to pass the FBCLID from Facebook into Everflow links in order for CAPI to work properly.
For example:
1. Shopper clicks on a Facebook Ad and lands on - https://coolstuff.com/product?fbclid=1234 (the FBCLID is automatically added by FB)
2. You would then need to write a script that reads “fbclid=1234” from the original URL and inserts it into the Everflow link - https://deals.getproduct.io/ABC123/?altdomain=product-coolstuff.com&gupix=fb.1234567890&fbclid=1234
This FBCLID is the primary identifier that Facebook uses to associate events back to your ads.The easiest solution would be to add a javascript snippet to the presell page that parses the current browser URL query string (reads what's in the query string), extracts the URL parameters and then modifies the Everflow tracking links on the page to re-append the parsed query string (adds the query string to the Everflow URL).This is something a 3rd party developer should be able to assist with if needed.''
Does anyone have such a script that i can add to my lander? I am using clickfunnels
So Thankful if anyone could help!!!
@
schlossy @
ScottyG Hi guys. Can you please advise what to do if we are using Direct GiddyUp URL on Facebook.
For example:
https://deals.getphotostick.io/ABC12...-coolstuff.com
Do we need to add fbclid parameter in the end? and What is the fbclid parameter format? Is it &fbclid={{fbclid}}
https://deals.getphotostick.io/ABC123/?altdomain=photostick-coolstuff.com&fbclid={{fbclid}}
Please help. Thank you.
03-03-2022 11:34 AM
#7
ScottyG (Senior Member)

Originally Posted by
asharjamil
@
schlossy @
ScottyG Hi guys. Can you please advise what to do if we are using Direct GiddyUp URL on Facebook.
For example:
https://deals.getphotostick.io/ABC12...-coolstuff.com
Do we need to add fbclid parameter in the end? and What is the fbclid parameter format? Is it &fbclid={{fbclid}}
https://deals.getphotostick.io/ABC123/?altdomain=photostick-coolstuff.com&fbclid={{fbclid}}
Please help. Thank you.
I don't believe you add anything, FB automatically adds the fbclid utm parameter.
I'm not positive and I don't run FB though, you can test by launching an ad, previewing it and examining the link though.
03-03-2022 11:48 AM
#8
schlossy (Member)

Originally Posted by
asharjamil
@
schlossy @
ScottyG Hi guys. Can you please advise what to do if we are using Direct GiddyUp URL on Facebook.
For example:
https://deals.getphotostick.io/ABC12...-coolstuff.com
Do we need to add fbclid parameter in the end? and What is the fbclid parameter format? Is it &fbclid={{fbclid}}
https://deals.getphotostick.io/ABC123/?altdomain=photostick-coolstuff.com&fbclid={{fbclid}}
Please help. Thank you.
bro the full setup guide is on the "pixel and domain' section. use the url they auto make for you and copy paste the web code they provide to you on your lander
03-03-2022 10:47 PM
#9
asharjamil (Member)

Originally Posted by
ScottyG
I don't believe you add anything, FB automatically adds the fbclid utm parameter.
I'm not positive and I don't run FB though, you can test by launching an ad, previewing it and examining the link though.
Thanks Scotty. This is what I thought. Let me see.
03-03-2022 10:58 PM
#10
asharjamil (Member)

Originally Posted by
schlossy
bro the full setup guide is on the "pixel and domain' section. use the url they auto make for you and copy paste the web code they provide to you on your lander
I have done the setup exactly like the documentation. It is tracking all the events - Add To Carts, Page View, Purchase etc.
My concern is why all the purchases are attributed to unknown. For example please see the below screenshots of my ad:

You can see all the Purchases are attributed to Unknown. Age is Unknown. Regions and Countries are Unknown.
My questions is when you are running Facebook ads with GiddyUp, do you get this data or it is always attributed to Unknown? Thanks.
03-04-2022 08:43 AM
#11
schlossy (Member)

Originally Posted by
asharjamil
I have done the setup exactly like the documentation. It is tracking all the events - Add To Carts, Page View, Purchase etc.
My concern is why all the purchases are attributed to unknown. For example please see the below screenshots of my ad:

You can see all the Purchases are attributed to Unknown. Age is Unknown. Regions and Countries are Unknown.
My questions is when you are running Facebook ads with GiddyUp, do you get this data or it is always attributed to Unknown? Thanks.
yup always to unknown
03-04-2022 09:07 AM
#12
asharjamil (Member)
@schlossy Thank you. I was worried that maybe it is just me. 
Home >
Paid Traffic Sources >
Facebook & Instagram