Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1249255

    DataSplit
    Participant

    I am trying to place a script in my website for advertising. I added it in a text block, but that isn’t working. How can I add a javascript code snippet to my website and have it show up?

    #1249376

    Jade
    Moderator

    Hi there,

    Try adding the code in a Raw Content element.

    Hope this helps.

    #1249381

    DataSplit
    Participant
    This reply has been marked as private.
    #1249678

    Rupok
    Member

    Hi there,

    It should work if the code is fine. If the external script needs to be added to header, you can follow this – https://community.theme.co/forums/topic/add-tracking-code-to-header/#post-776299

    Cheers!

    #1250287

    DataSplit
    Participant

    It isn’t working. The code I provided was the exact code given to me. That is what I put into the Raw Content area and the code works when tested elsewhere.

    #1250375

    Thai
    Moderator

    Hi There,

    I’ve tried with your code and it’s working fine.

    Please provide us with your admin account & website URL so we can take a closer look.

    Thanks.

    #1250427

    DataSplit
    Participant
    This reply has been marked as private.
    #1250753

    Friech
    Moderator

    Hi There,

    The code works on my end, please clear any caching/optimiser plugin your site might have.

    Thanks.

    #1250783

    DataSplit
    Participant

    I cleared cache from the plugin and also cleared cookies and history of the site from my browser. The ad still isn’t showing up.

    #1250793

    DataSplit
    Participant
    This reply has been marked as private.
    #1250911

    DataSplit
    Participant

    If I run two ads, it is replacing the top one with the bottom one. Even though it specifies the sizes it will change them. All of this is correlated to some javascript issue with the theme and cornerstone.

    #1251153

    Rue Nel
    Moderator

    Hello There,

    I am another staff checking on this thread! Upon checking, there is a JS error on the page:
    http://prntscr.com/d5dhz9

    It sounds like you might be having an issue with a third party AD script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

    Thank you for your understanding.

    #1251156

    DataSplit
    Participant

    This has nothing to do with a third party. It is a script for an ad that needs to be placed in the raw content element. Should it be placed within a different Cornerstone element for it to work? There is no third party to go to. It just simply isn’t working in the X-Theme.

    #1251229

    Rue Nel
    Moderator

    Hello There,

    If you want to add a raw code or script in Cornerstone, the best element could do it is the Raw Content element. Any content or script you will add in the raw content element is considered as a 3rd party code especially if it comes from other source like the ad network.

    Now using your code;

    <div class="alignleft">
    <script type="text/javascript">
    amzn_assoc_ad_type = "banner";
    amzn_assoc_marketplace = "amazon";
    amzn_assoc_region = "US";
    amzn_assoc_placement = "assoc_banner_placement_default";
    amzn_assoc_campaigns = "software";
    amzn_assoc_banner_type = "category";
    amzn_assoc_p = "14";
    amzn_assoc_isresponsive = "false";
    amzn_assoc_banner_id = "1A6VS9NZQW89EZBP9CR2";
    amzn_assoc_width = "160";
    amzn_assoc_height = "600";
    amzn_assoc_tracking_id = "analyticsente-20";
    amzn_assoc_linkid = "6e6f2f15cc73216be682279493db14d3";
    </script>
    <script src="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1"></script>
    </div>

    I tested this in my local install and it just works. I even use the code multiple times. You can see it here:
    http://prntscr.com/d5e1gf
    http://prntscr.com/d5e1p6

    Please keep in mind that there are times that you cannot see the contents of the raw content element working in Cornerstone preview. Most of the time, (assuming that there are no error with the code), it will display in the live page view.

    Please make sure that you have inserted the correct code. If you insert with invalid quotes, it will not work out anymore. I have checked your site and see to it that the code is correct. The weird thing is that it has a JS error generated from the code itself. This is presented in this screenshot: http://prntscr.com/d5dhz9

    There is something wrong with the code itself because it is not showing in your site.

    Hope this make sense.

    #1251267

    DataSplit
    Participant

    I got it to show up now in the right hand side and in the middle of the page. How do I center those ads in the raw content element?