chris91
November 20, 2019, 6:57pm
1
Hi friends,
We need to add Intercom and Hubspot Javascript to one subdomain, how can we go about this with Cloudflare?
For reference, here are the lines of code we need to add;
<script>
window.intercomSettings = {
app_id: "*****"
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/qyau07fy';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();</script>
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/4287822.js"></script>
<!-- End of HubSpot Embed Code -->
Thanks everyone!
sandro
November 20, 2019, 7:06pm
2
If you want to use Cloudflare for that you will have to enable paid workers and add this via a worker script.
Not sure thats the best approach though, simply add it to your site on your server
chris91
November 20, 2019, 8:35pm
3
Thanks! How would we structure this worker?
That’s where we’re lost.
sandro
November 20, 2019, 8:38pm
4
Something of that sort might work
Hey guys - I’m not a developer - Digital marketer.
Its my first time working with workers. I have been playing around with it and doing some reading.
I love some help creating a recipe - What I would require = I’m working on client site, would like like that when someone lands on specific page - wwww…operators/contact the worker will trigger a speak script that I wrote.
How would I go about this? I can post the script for context if that helps.
M4rt1n
November 20, 2019, 10:40pm
5
Dude you can solve this the CF-Way or the native way…
Pls do whatever you like but you should srsly consider implementing it the native way. Go to the Subdomain and add it to the HTML or include it as a file in the header.
You can use workers for this but this is the lazy way and you would have to paid for and just gaining something you could do yourself with less to no effort
system
Closed
December 4, 2019, 6:57pm
6
This topic was automatically closed after 14 days. New replies are no longer allowed.