[Support request] Amazon Script Won't Show in Hook Element

Home Forums Support [Support request] Amazon Script Won't Show in Hook Element

Home Forums Support Amazon Script Won't Show in Hook Element

  • This topic has 24 replies, 2 voices, and was last updated 3 years ago by David.
Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #1027963
    Anthony

    I’m trying to insert an Amazon affiliate native ad inside a hook to display it just before the comments container. I can’t get it to show up.

    There’s 4 types of ads. two of them are just links, one is an iframe, but this native one is a script.

    Can you not show script unless it’s in the header or footer script hook?

    #1028227
    David
    Staff
    Customer Support

    Hi there,

    i can see some affiliate ads before the comments container – maybe browser cache needs clearing?

    #1028498
    Anthony

    Hey David,

    I ended up putting one of the other four types of ads in there until I’m able to show the <script> inside the hook.

    The four ad types are “Text, Image, Text & Image and Native Ads”.

    Native ads is a script while the other three are text and iFrames.

    #1028540
    David
    Staff
    Customer Support

    So the script works if you move it to another hook?

    #1028931
    Anthony

    No, sorry.

    It’s not working in any hook.

    It’s an Amazon Associates – Native Shopping Ad.

    It’s an <iFrame>.

    I was hoping to display the Native Shopping Ad using a hook to insert it onto my pages.

    Anthony

    #1029276
    David
    Staff
    Customer Support

    Can you share the code you’re adding here?
    Before submiting – if you can highlight the code and click the Code Button to preserve its formatting.

    Aside of that – silly question have you selected the correct display rules….

    #1030395
    Anthony

    Hey Dave,

    This is the script here:

    <script type="text/javascript">
    amzn_assoc_tracking_id = "mini08-20";
    amzn_assoc_ad_mode = "manual";
    amzn_assoc_ad_type = "smart";
    amzn_assoc_marketplace = "amazon";
    amzn_assoc_region = "US";
    amzn_assoc_design = "enhanced_links";
    amzn_assoc_asins = "1623156610";
    amzn_assoc_placement = "adunit";
    amzn_assoc_linkid = "cf585f0c564164615825dc4c9b944d54";
    </script>
    <script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>

    I have it set to display on all “recipes” which is a custom post.

    Anthony

    #1030411
    David
    Staff
    Customer Support

    The hook is working as i can see the script in the markup.
    But there is an error in the console related to the onejs script that is being called.

    You would need to speak with the provider to find out what the possible causes are.
    Before doing so worth clearing and disabling any cache plugins just in case there causing a conflict.

    #1030424
    Anthony

    Hmm.

    Am I contacting cloudfare, my host, or the recipe plugin developer?
    Seems to be a few console errors I was unaware of.

    Thanks

    #1030429
    David
    Staff
    Customer Support

    the error is related to the amazon script – so i would seek amazons ad service support.
    But its worth eliminating any possibility it is server / cloudflare related first.

    #1030433
    David
    Staff
    Customer Support

    I had a look around and this is the amazon guide to adding them:

    https://affiliate-program.amazon.com/help/topic/t405

    They recommend using the AdInserter plugin – not sure why that would make a difference but worth giving that a shot to see if it works.

    Also what happens if you add the script within the post content itself?

    #1036521
    Anthony

    Hey David,

    Sorry for the delay.

    It’s not working right in the content either, weird.

    It’s annoying. About a month or two ago I could paste these and I swear they worked.

    #1036530
    Anthony

    After digging around I found this answer here:

    https://stackoverflow.com/questions/49851104/how-to-load-script-in-react-component/50843982#50843982

    Which lead to this:

    https://www.npmjs.com/package/postscribe

    Which I’m having a hard time understanding.

    #1036534
    David
    Staff
    Customer Support

    Can you point me to what lead you to the first stackoverflow link ?
    Async JS will remove render blocking but not sure it explains why its not loading at all.

    #1036535
    Anthony

    I pasted the JS error into Google.

Viewing 15 posts - 1 through 15 (of 25 total)
  • You must be logged in to reply to this topic.