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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.