menu

arrow_back How do I check if a user is viewing ads in php?

by
1 vote
I have an application that uses a php backend. Let's say it's an application to accrue views on YouTube, or something else where points are very important. I want to implement scoring for ad views, but I don't know how to do it. I can of course send a request to the server when the ad has been viewed
@Override
public void onAdOpened() {
//Запрос на сервер
}
But I'm afraid that a person digging in the code of my application can easily find what request I send, and can easily emulate my requests for scamming points. How can I avoid this? For example, is there any way to check from the server whether the ads were viewed?

1 Answer

by
 
Best answer
0 votes
So encrypt the request and send it encrypted to the server, checking the integrity of the data to make sure it is unchanged. Include browse time in the request so that the attacker doesn't send the same request. Analyze the IP of the request so that it doesn't repeat itself. If you add additional data (about the user's behavior, when he opened the ad, how much time he spent, how he behaved in the application) it will be difficult to fake such a request and you will know if this is a live person or a bot.
The more complicated you make it, the harder it will be to break in.