The World's First Contextual Real-Time Quiz

Learn More
shape-1
TriviaTrap.ai

Embed TriviaTrap.AI on Your Website

Copy and Paste the code below into the body of your site where you want the quiz to appear. For best results place the quiz Above the Fold.
To embed an iframe with the current page title as the subject of the quiz, use the following code:

<script>
     document.addEventListener('DOMContentLoaded', function() {
        function getParentTitle() {
            return encodeURIComponent(document.title);
        }

        function getParentDomain() {
            return encodeURIComponent(window.location.hostname);
        }

        // Get all iframe elements with the class "iframe-class"
        let iframes = document.getElementsByClassName('iframe-class');
        let title = getParentTitle();
        let domain = getParentDomain();

        for (let i = 0; i < iframes.length; i++) {
            iframes[i].src = "https://triviatrap.ai/store-mcqs?content=" + title + "&domain=" + domain;
        }
    });
</script>
<iframe class="iframe-class" style=" width: 300px; height:250px;"></iframe>
<script>
    const iframes = document.getElementsByClassName('iframe-class');

    Array.from(iframes).forEach((iframe) => {
        iframe.onload = function() {
            try {
                // Attempt to get the content height
                let contentHeight = iframe.contentWindow.document.body.scrollHeight;
                contentHeight = contentHeight + 30;
                iframe.style.height = contentHeight + 'px';
            } catch (error) {
                iframe.style.height = '250px';
            }
        };
    });
</script>
`

Frequently Asked Questions

How do I load the embed code on my website?

To load the TriviaTrap.AI embed code on your website, follow these steps:

  • Copy the embed code provided above.
  • Paste the code into the HTML of your website where you want the quiz to appear.
  • Ensure that the code is placed within the <body> tag of your HTML.
  • Save your changes and refresh your website to see the TriviaTrap.AI quiz in action!

Is TriviaTrap free to use?

Yes! Currently, TriviaTrap.AI is offering free access to our quiz embedding code as part of a limited-time promotion. You can embed real-time, contextual quizzes on your website with no cost, helping you boost engagement and earn ad revenue without any upfront investment. To remove ads on quizzes please contact us at support@triviatrap.ai

What is your privacy policy?

Our privacy policy ensures the protection of user data:

  • Quiz responses are anonymized for analysis and improvement of our AI.
  • We use industry-standard security measures to protect all collected data.
  • Read our full privacy policy here.

What are the terms and conditions of use?

Our terms and conditions cover the following key points:

  • Publishers must own or have the right to use the websites where TriviaTrap.AI is embedded.
  • Content must be family-friendly and adhere to our community guidelines.
  • Publishers may not manipulate the quiz system or artificially inflate engagement.
  • TriviaTrap.AI reserves the right to remove the quiz from any site violating our terms.
  • Full terms and conditions can be found here.