Skip to main content

Best Practices (MediaGuard)

To help you get the most out of MediaGuard, we've outlined a set of best practices for you to follow. These tips and guidelines are designed to maximize performance, minimize latency, and keep your MediaGuard integration as stable as possible.

Don't expose MediaGuard's predictions

Here at HUMAN, we've used our suite of IVT detection tools to identify coordinated ad fraud operations and other groups of bad actors. Thanks to these efforts, fraudsters are eager to reverse-engineer our tools—which means you must ensure that none of MediaGuard's predictions are exposed to the outside world.

For example, if MediaGuard returns an ivt = true prediction for a particular bid request, it's critical that this response isn't shared with the website or device where the bid request occurred. Keeping responses hidden makes it harder for fraudsters to figure out how our tools work, which makes it harder for them to evade detection.

Test your cluster

As part of the MediaGuard integration process, HUMAN will provide you with a dedicated server cluster to handle your requests to MediaGuard. After you've successfully authenticated and processed bid requests with MediaGuard, you should test your cluster to ensure that it performs well under a variety of scenarios, like traffic spikes or partial outages.

We recommend running some or all of the following tests:

  • Add artificial latency to one or more nodes in your cluster
  • Terminate an active node in your cluster
  • Cut the network to a node in your cluster
  • Apply the maximum expected traffic to a single node, then remove a node from your cluster
  • Apply the maximum expected traffic to your entire cluster, then remove a node from your cluster
  • Apply the maximum expected traffic to a single node, then add a new node to your cluster
  • Apply the maximum expected traffic to your entire cluster, then add a new node to your cluster
NOTE

These tests are applicable to all MediaGuard integrations, regardless of whether you're using the MediaGuard API or the MediaGuard SDK.

Maintain persistent connections

MediaGuard API

If your integration is built on the MediaGuard API, you should maintain persistent connections by including the Connection and Keep-Alive headers in your requests. A HUMAN representative will help you fine-tune the correct header values for your integration.

Additionally, you should avoid using intermediary proxies or firewalls, as these can all limit or disconnect your connections to MediaGuard.

MediaGuard SDK

If your integration is built on the MediaGuard SDK, the MediaGuard SDK automatically creates persistent connections on your behalf. However, you'll still need to avoid using intermediary proxies or firewalls, as these can all limit or disconnect your connections to MediaGuard.

Implement load balancing

MediaGuard API

If your integration is built on the MediaGuard API, you'll need to implement your own load balancing.

MediaGuard SDK

If your integration is built on the MediaGuard SDK, you don't need to implement load balancing, since the MediaGuard SDK automatically handles load balancing on your behalf. In fact, we do not recommend adding your own load balancing layer, since this can introduce additional latency and make both load balancing layers less efficient.

Perform health checks

MediaGuard API

If your integration is built on the MediaGuard API, you should use the /health-check endpoint to perform regular health checks. The frequency at which you perform health checks is up to you; we recommend configuring your systems to automatically call this endpoint anywhere from once every ten seconds to once per minute.

The /health-check endpoint's responses will provide you with information about MediaGuard's status. A 200 response indicates that MediaGuard is healthy, but a 503 response indicates that MediaGuard is unable to receive requests. If you receive a 503 response, you should first verify that your integration is configured correctly; then, if issues persist, you should reach out to a HUMAN representative for assistance.

MediaGuard SDK

If your integration is built on the MediaGuard SDK, you don't need to perform health checks—the MediaGuard SDK automatically performs health checks on your behalf.