Jump to content

Limit an external script call once by cookie


sfraise

Recommended Posts

I'm trying to find a clean way to only call an external script once per visit using cookies but am having some trouble with it.

I think the main issue lies in the actual calling of the script within the script. The problem is the js is on a 3rd party site which I don't have access to, they simply give me a <script>'http://pathtoscript.js'</script> to place in the body of the page. It's super annoying to have this script load on every page load for the visitor and really need to limit it to only once per visit.

 

I thought about using an iframe to try and get around the problem by placing the script on the iframe page and then only loading the iframe once per visit but I was hoping there might be a cleaner way to do it.

 

Anyone have any ideas on how to do this cleanly?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.