1

I have inserted the code snippets given by rewardful into my next.js _document.js file in order to have the required code on every page, like this:

useEffect(() => {
    function func1(w,r) {
      w._rwq=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)}
    }
    func1(window,'rewardful');
  }, []);

And this is my head tag. APIKEY replaces the API key I have in the code:

<Head>
<link rel="preconnect" href="https://fonts.googleapis.com"></link>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin></link>
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap" rel="stylesheet"></link>
<Script async src='https://r.wdfl.co/rw.js' data-rewardful='APIKEY'></Script>
</Head>

I am using Stripe elements as a checkout, and when I try to call window.rewardful('convert', { email: email });, or rewardful('convert', { email: email });, I am told that window.rewardful is not a function and rewardful is not defined respectively.

It is being called when paymentIntent.status is succeeded.

rob
  • 83
  • 6
  • 2
    Hey Rob, I work for Rewardful. What's your website/app? I'll get one of the devs to take a look, and then provide a response here for others to see. – Emmet Gibney Jul 26 '23 at 19:09
  • Sorry for the late reply, here is the deployment with the rewardful integration: https://wifistacks-git-main-robtherobot12.vercel.app/ – rob Jul 29 '23 at 10:08
  • hey Rob, sorry for the delay coming back here, we don't monitor SO that often. The support team said that they'll need more information to help and doing so on here might take a bit too much back and forth. Can you please reach out to support and then once we figure out the issue you can post the answer here after the fact. – Emmet Gibney Aug 03 '23 at 09:45
  • I managed to sort the issue with your team a few days after I posted that comment, I'll post a solution soon – rob Aug 13 '23 at 08:39

0 Answers0