• Resolved dutchintouch

    (@dutchintouch)


    With SiteGround Optimizer engaged my Amazon.com js ads do not show. They use this script, but I do not see where I can exclude it from the optimization settings:

    <script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @dutchintouch,

    I hope you are doing well!

    If you wish to exclude a resource loaded from an external source, you can exclude external script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code:

    add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
    function js_combine_exclude_external_script( $exclude_list ) {
        $exclude_list[] = 'script-host.com';
    
        return $exclude_list;
    }

    If you’ve added the script as an inline script, you can exclude the inline script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code:

    add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
    function js_combine_exclude_inline_script( $exclude_list ) {
        $exclude_list[] = 'first few symbols of inline content script';
    
        return $exclude_list;
    }

    If you still have any issues after that, feel free to reach back to us.

    Kind regards,
    Stoyan

    Thread Starter dutchintouch

    (@dutchintouch)

    I have added the filter to the functions.php file of my child theme. I used “z-na.amazon-adsystem.com” as the external script source.

    After uploading the file I purged the Optimizer cache.

    However, the ads still do not display.

    Thread Starter dutchintouch

    (@dutchintouch)

    This was marked ‘resolved,’ but the ads I referred to still do not show up.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Amazon JS ads not showing’ is closed to new replies.