Share for AI Analysis

In this resource, you’ll get:

You’ll get a ready-to-use JavaScript snippet and a tiny toast helper to trigger AI tools from any link. Add links with a class and a data-ai attribute, publish, and your readers can fire an instant “analyze this page” prompt in their AI app of choice—no backend required.

This script adds “Share to AI” behaviour to any link by reading the page URL at runtime, composing a concise analysis prompt, and either opening the target AI app with the prompt prefilled or copying the prompt and showing a toast with a direct-open button when deep linking isn’t supported. To use it in Webflow, place the snippet in a global embed before </body> or on specific pages, then create links or buttons with the class insights_ai-link and set data-ai to one of gpt, perplexity, claude, Gemini, or DeepSeek. You can fine-tune the default prompts in the config object, translate messages, or swap the toast for your site’s toast component; the logic is isolated and safe to drop into any page template.

How to use in Webflow:

  1. Create a UI interface which display the different AI tools as a button
  2. Give each button a attribute of 'data-ai=<ai name>'
  3. Copy the snippet below and add into the Page Settings

Unlock this resource for free

<script>
document.addEventListener('DOMContentLoaded', () => {
  const pageUrl = window.location.href;
  const config = {
    gpt: { url: 'https://chat.openai.com/?q=', prompt: `Visit this URL and summarise this post for me and remember the key facts: ${pageUrl}`, direct: true },
    perplexity: { url: 'https://www.perplexity.ai/search?q=', prompt: `Visit this URL and summarize the post for me: ${pageUrl}`, direct: true },
    claude: { url: 'https://claude.ai/new?q=', prompt: `Analyze and summarize this article: ${pageUrl}`, direct: true },
    gemini: { url: 'https://gemini.google.com/app', prompt: `Analyze this article and give your insights: ${pageUrl}`, direct: false },
    deepseek: { url: 'https://chat.deepseek.com/', prompt: `Analyze this article and give your insights: ${pageUrl}`, direct: false }
  };

  const copy = text => navigator.clipboard?.writeText(text).catch(() => false);
  
  document.querySelectorAll('.insights_ai-link').forEach(btn => {
    const ai = config[btn.getAttribute('data-ai')];
    if (!ai) return;
    
    btn.onclick = e => {
      e.preventDefault();
      if (ai.direct) {
        window.open(ai.url + encodeURIComponent(ai.prompt), '_blank');
      } else {
        copy(ai.prompt).then(() => {
          alert(`Prompt copied. Now open ${btn.getAttribute('data-ai')}.`);
        });
        window.open(ai.url, '_blank');
      }
    };
  });
});
</script>
Copy Code
Oops! Something went wrong while submitting the form.
<script>
document.addEventListener('DOMContentLoaded', () => {
  const pageUrl = window.location.href;
  const config = {
    gpt: { url: 'https://chat.openai.com/?q=', prompt: `Visit this URL and summarise this post for me and remember the key facts: ${pageUrl}`, direct: true },
    perplexity: { url: 'https://www.perplexity.ai/search?q=', prompt: `Visit this URL and summarize the post for me: ${pageUrl}`, direct: true },
    claude: { url: 'https://claude.ai/new?q=', prompt: `Analyze and summarize this article: ${pageUrl}`, direct: true },
    gemini: { url: 'https://gemini.google.com/app', prompt: `Analyze this article and give your insights: ${pageUrl}`, direct: false },
    deepseek: { url: 'https://chat.deepseek.com/', prompt: `Analyze this article and give your insights: ${pageUrl}`, direct: false }
  };

  const copy = text => navigator.clipboard?.writeText(text).catch(() => false);
  
  document.querySelectorAll('.insights_ai-link').forEach(btn => {
    const ai = config[btn.getAttribute('data-ai')];
    if (!ai) return;
    
    btn.onclick = e => {
      e.preventDefault();
      if (ai.direct) {
        window.open(ai.url + encodeURIComponent(ai.prompt), '_blank');
      } else {
        copy(ai.prompt).then(() => {
          alert(`Prompt copied. Now open ${btn.getAttribute('data-ai')}.`);
        });
        window.open(ai.url, '_blank');
      }
    };
  });
});
</script>
Copy Code