Site logo

Archived topic

How can I add a Script to GP

5 replies · Started by Samuel on October 2, 2018

Viewing posts 1–6 of 6

I'm using GP Premium and elemntor for my site, and I just affiliate to clickbus a program to sell bus tickets, but they want me to add the script below, my question is, where should I add it? is there an specific folder I should use? or should I just add it in every page I need it?, please let me know, I dont want to screw something up

<script>
!function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id + s)) {
js = d.createElement(s);
js.id = id + s;
js.src = "https://s3.amazonaws.com/clickbusmx-widget-v2/build/static/js/main.js";
fjs.parentNode.insertBefore(js, fjs);
}
var cssId = 'clickbus.main.css'; // you could encode the css path itself to generate id..
if (!document.getElementById(cssId))
{
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://s3.amazonaws.com/clickbusmx-widget-v2/build/static/css/main.css';
link.media = 'all';
head.appendChild(link);
}
}(document, "script", "mx.com.clickbus.widget");
</script>

Thanks, I was able to pull it off.

No problem :)

Hey need to paste the following code just before </body>tag. How can I do this. I am using latest version of GP premium.

<script> var websiteId = "03dc78b3-e5a6-4755-ae63-4220273c12b5";</script> <script src="https://app.qualzz.com/assets/trackingScript/webtracking.js" type="text/javascript"></script>

Please open a new topic for your question.

Thanks!

This archived topic is closed to new replies.