# Testing and troubleshooting

> How to test your integration before launch, and how to fix the problems we see most often.

Source: https://docs.moonetix.com/testing

## Test the offerwall link

1. In Integration status on the Integration tab, click Check a link. Paste a link your site made to have it checked the way the offerwall does, or type a user ID into Test a link to see the exact link your server should build.
2. Build the link with your own code for the same user ID and compare the two. They must be identical.
3. Open your link. You should see the offerwall, not the Link not valid page.

To see the offerwall without building a link, click Open as a test user in Integration status. It opens your offerwall with the user ID `owner-test`, and test visits are not counted as users.

## Test from a normal connection

The offerwall blocks VPNs, proxies, Tor, and data center networks, because offers cannot track users through them. If you test through one of them, for example on a cloud server, a remote desktop, or a test device in the cloud, you see a block page instead of offers:

| Page | Reason |
| --- | --- |
| VPN detected | The connection goes through a VPN. |
| Proxy detected | The connection goes through a proxy. |
| Tor detected | The connection goes through Tor. |
| Network not supported | The connection comes from a server or data center network. |

Turn the VPN off, or test on a phone with mobile data. The check runs when the offerwall or an offer page opens, so it also covers the mobile SDKs and the `start_url` of the Offers API. Offers API requests from your server are not checked.

## Test postbacks

1. Save your postback URL in the Postback tab, then use Send a test postback in Integration status on the Integration tab.
2. A Test postback result window shows what your server answered: the response code, the answer time, the request we sent, and the exact answer. Every attempt is also listed under Reports, Postbacks.
3. You choose the user ID, the status, and the payout. The transaction ID of a test always starts with `test_`.

## Before you go live

- Your currency is set. Open the Currency tab and check what users get with its calculator. See [Rewards and currency](https://docs.moonetix.com/rewards).
- Your server builds the offerwall link, the Offers API request, or the SDK token, and only for the signed-in user. The link hash salt, the postback secret key, and the API key are on your server only, never in a page or an app.
- Link security is on in the Integration tab. It is on by default.
- Your postback handler checks the hash, credits each `transaction_id` once, takes the reward back on status 2, and answers with a 2xx code within 6 seconds. See [Postbacks](https://docs.moonetix.com/postbacks).
- A test postback with status 1 and one with status 2 both reach your server, and Reports, Postbacks shows that your server answered 200.
- You removed the rewards of your test postbacks from `test_user` and any other test account.
- Users can find My offers, where they follow their offers and report a missing reward. On the offerwall it is in the top menu. With the Offers API, link to `history_url`.
- Your own terms say that a reward can be taken back if the advertiser reverses the result. See [What your server should do](https://docs.moonetix.com/credits-and-reversals#what-to-do).
- For a mobile app, you added the offerwall data to the App Store privacy details and Google Play’s Data safety form. See [iOS](https://docs.moonetix.com/ios-sdk#privacy) and [Android](https://docs.moonetix.com/android-sdk#privacy).
- You opened the offerwall from a normal home or mobile connection, in a country where offers run, on each kind of device your users have.

## Common problems

| What you see | Cause | Fix |
| --- | --- | --- |
| Link not valid | The hash does not match the user ID. | Sign the exact user ID you put in the link, use the link hash salt, not the postback secret key, and output lowercase hex. |
| Missing user ID | The user ID is empty or has characters we do not accept. | Use 1 to 100 characters from `A-Z a-z 0-9 . _ @ : + -` and URL-encode it. |
| The offerwall does not load in your iframe or pop-up | The page is not on the website you registered for the app, or it is not an https page. | Embed it on an https page of that domain or one of its subdomains. For another site, add a new app. |
| The floating button does not show | `data-button-url` is missing or is not an offerwall link. The browser console shows a warning from Moonetix embed. | Use the full signed link that starts with `https://wall.moonetix.com/`, and check that nothing on your page blocks the script. |
| VPN detected, Proxy detected, Tor detected, or Network not supported | The offerwall blocks these connections. | Test from a normal home or mobile connection. See [Test from a normal connection](https://docs.moonetix.com/testing#vpn). |
| Fewer offers than expected | You hid some offers, or fewer offers run in the user’s country or on their device. | Open Offers in your dashboard and set Status to Hidden. Click Show to bring an offer back. |
| Postback log shows 403 or 404 | Your script rejected the postback, or the URL is wrong. | Open the URL from the log in a browser and check your hash code. |
| Postback log shows a timeout | Your script takes longer than 6 seconds. | Answer with 200 first, or make the slow work run in the background. |
| Postback log shows 301 or 302 | Your URL redirects, for example from http to https. | Use the final URL. We do not follow redirects. |
| Postbacks never arrive | A firewall or bot protection blocks server requests. | Allow our requests to your postback path. Our IP addresses are listed in [Postbacks](https://docs.moonetix.com/postbacks). |
| You see `{user_id}` in your logs | A macro is misspelled. | Copy the macros from the Postback tab. |
| Hash mismatch on postbacks | The values were changed before hashing, or the wrong key is used. | Hash the values exactly as received, in the order transaction ID, user ID, reward, status, with the postback secret key. |
| A user got a reward twice | The same transaction was processed twice after a retry. | Store the last status per transaction ID and skip repeats. |

## Questions

### Can I use the same app for my website and my mobile app?

Yes, as long as the user ID is the same for the same person on both. If they need different currencies, add a second app.

### Do I get a postback when a user only starts an offer?

No. Started and expired offers are shown to the user on the offerwall, but they are not sent to you.

### Can the reward in a postback be negative?

No. The status tells you whether to add or take back.

### Who do my users contact about a missing reward?

Users can report it on the offerwall itself: each offer in My offers has a Report button, and our team checks the report with the advertiser. If a user contacts you instead and your own records do not solve it, send us the user ID, offer name, and date at [partners@moonetix.com](mailto:partners@moonetix.com).
