[Resolved] How can I add a Script to GP

Home Forums Support [Resolved] How can I add a Script to GP

Home Forums Support How can I add a Script to GP

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #691798
    Samuel

    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&#8221;;
    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&#8217;;
    link.media = ‘all’;
    head.appendChild(link);
    }
    }(document, “script”, “mx.com.clickbus.widget”);
    </script>

    #691888
    Leo
    Staff
    Customer Support

    Hi there,

    Try the wp_footer hook in Hooks Element:
    https://docs.generatepress.com/article/hooks-element-overview/

    Let me know ๐Ÿ™‚

    #693656
    Samuel

    Thanks, I was able to pull it off.

    #693670
    Leo
    Staff
    Customer Support

    No problem ๐Ÿ™‚

    #1878716
    Balendu

    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&#8221; type=”text/javascript”></script>

    #1878741
    Leo
    Staff
    Customer Support

    Please open a new topic for your question.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How can I add a Script to GP’ is closed to new replies.