Cloudflare is blocking the tripadvisor widget and i need to create a rule

Hi everyone, we found out that Cloudflare was blocking our tripadvisor widget. I need to create a rule to let Cloudflare to display properly the widget, but i think i don’t do it properly.

This is the widget code we use:

Summary
<div id="TA_cdsratingsonlynarrow592" class="TA_cdsratingsonlynarrow"><ul id="7WtDmv5qQGi" class="TA_links 6KmNLss7j3M"><li id="3xLiG5y" class="9uX577Go"><a target="_blank" href="https://www.tripadvisor.com/Attraction_Review-g1210687-d3186766-Reviews-SSS_Phuket_Dive_Freedive_Surf_Center-Kata_Beach_Karon_Phuket.html"><img src="https://www.tripadvisor.com/img/cdsi/img2/branding/v2/Tripadvisor_lockup_horizontal_secondary_registered-18034-2.svg" alt="TripAdvisor"/></a></li></ul></div><script async src="https://www.jscache.com/wejs?wtype=cdsratingsonlynarrow&amp;uniq=592&amp;locationId=3186766&amp;lang=en_US&amp;border=true&amp;display_version=2" data-loadtrk onload="this.loadtrk=true"></script>

Thanks for helping!

My best guess is the conflict with the Rocket Loader since it’s calling the script? :thinking:

May I ask have you tried disabling the Rocket Loader? Does it work then? :thinking:

There is a way to either disable it for the whole domain and other proxied DNS hostnames, or keeping it enabled but disable it for some particular /path/ via Page Rule.

Nevertheless, we can disable it for loading over a particular JS script.
In your case, if you want to exclude executing the Rocket Loader on Statcounter script/plugin, add the data-cfasync='false' attribute at your script tag before the src attribute as the instructions suggest from the article below.

The end result with modified code would look like below:

<div id="TA_cdsratingsonlynarrow592" class="TA_cdsratingsonlynarrow">
  <ul id="7WtDmv5qQGi" class="TA_links 6KmNLss7j3M">
    <li id="3xLiG5y" class="9uX577Go">
      <a target="_blank" href="https://www.tripadvisor.com/Attraction_Review-g1210687-d3186766-Reviews-SSS_Phuket_Dive_Freedive_Surf_Center-Kata_Beach_Karon_Phuket.html">
        <img src="https://www.tripadvisor.com/img/cdsi/img2/branding/v2/Tripadvisor_lockup_horizontal_secondary_registered-18034-2.svg" alt="TripAdvisor" />
      </a>
    </li>
  </ul>
</div>
<script data-cfasync='false' async src="https://www.jscache.com/wejs?wtype=cdsratingsonlynarrow&amp;uniq=592&amp;locationId=3186766&amp;lang=en_US&amp;border=true&amp;display_version=2" data-loadtrk onload="this.loadtrk=true"></script>

Helpful article:

1 Like

Hi, thank you for your help.

Yes by deactivated Rocket loader, the tripadvisor widget load correctly. However i am not exactly sure where to add the script you shared above.
Is it a Page Rule?

best,

Jean,

How does the widget code work? Is it being generated/inline added via some other JS code, or embeded by copy-paste?

Actually your code above worked, after clearing cache the widget appeared correctly with the Rocket loader on.

Thank you very much!

2 Likes

I am happy to assist you :wink:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.