# Rewardful - Help needed to pass Referral ID to Xano

**URL:** <https://community.weweb.io/t/rewardful-help-needed-to-pass-referral-id-to-xano/2723>\
**Category:** Ask us anything\
**Created:** [May 17, 2023, 7:55pm UTC](https://community.weweb.io/t/rewardful-help-needed-to-pass-referral-id-to-xano/2723 "2023-05-17T19:55:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![franciscolora0524](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/franciscolora0524/32/1249_2.png) [@franciscolora0524](https://community.weweb.io/u/franciscolora0524)\
**Post date:** [May 17, 2023, 7:55pm UTC](https://community.weweb.io/t/rewardful-help-needed-to-pass-referral-id-to-xano/2723/1 "2023-05-17T19:55:47Z")

</div>

So I have a Rewardful script on the head of all the pages of my app, but one of the workflow actions I want to run depends on the value of that cookie. I can’t test this out on the editor because it looks like the scripts in the header don’t fire while in the weweb editor.

The issue I’m running into is passing the Rewardful “referral ID” to the client\_reference\_id parameter in Xano, that way I can track affiliates.

Once a user visits my weweb app via an affiliate link, the cookie is stored on the user’s browser, and I need to somehow pass that ID to the xano endpoint.

I’ve attached a screenshot of the JS code i want to test,

any ideas how?

 ![Screen Shot 2023-05-17 at 3.52.15 PM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/3b1c5c07fc0cdfc4d451e042ce37170928ec6b19.jpeg)

---

<div class="post-metadata">

**Author:** ![raelyn](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/raelyn/32/2803_2.png) [@raelyn](https://community.weweb.io/u/raelyn)\
**Post date:** [August 16, 2023, 2:58pm UTC](https://community.weweb.io/t/rewardful-help-needed-to-pass-referral-id-to-xano/2723/2 "2023-08-16T14:58:23Z")

</div>

Hey @franciscolora0524! How did you pass it in the end?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [August 16, 2023, 3:02pm UTC](https://community.weweb.io/t/rewardful-help-needed-to-pass-referral-id-to-xano/2723/3 "2023-08-16T15:02:10Z")

</div>

To run scripts in the Editor you gotta use @raydeck’s [https://weweb-embed.statechange.ai/](https://weweb-embed.statechange.ai/) WeWeb Embed converter.

---

<div class="post-metadata">

**Author:** ![raydeck](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/raydeck/32/384_2.png) [@raydeck](https://community.weweb.io/u/raydeck)\
**Post date:** [August 16, 2023, 11:04pm UTC](https://community.weweb.io/t/rewardful-help-needed-to-pass-referral-id-to-xano/2723/4 "2023-08-16T23:04:32Z")

</div>

Thank you for the shout-out @Broberto!

I would run the code as @franciscolora0524 had it in the page load event. You can put the rewardful script tag in the custom code header, but then you can only test after publishing. If you want to test in the editor, you would want to load that at the page load too. I made the weweb-embed.statechange.ai tool to make that easier.

A lot of my weweb videos on [https://youtube.com/@statechange](https://youtube.com/@statechange) are based on this two-step of loading in a script tag via the embedded, and then firing off whatever action you want to use with it in a later javascript step in the same workflow (after a delay) or in a later workflow.
