Skip to main content

🔧 Troubleshooting

This guide covers common issues you might encounter when implementing Magfi Ad Network and provides solutions to help you resolve them quickly.

Duplicate AD_CODE Definitions

  • Problem: Defining the same AD_CODE more than once on a single page can prevent ads from displaying correctly or at all.
  • Solution: Ensure that each AD_CODE is defined only once per page. Duplicate definitions can confuse the ad server and result in unexpected behavior. Carefully review your ad placement code to eliminate any redundant AD_CODE declarations.

SDK Script Integration

  • Problem: Placing the SDK script in the incorrect location can impact performance and ad functionality.
  • Solution: The SDK script must be integrated within the <header> section of your HTML document. This ensures that the SDK is loaded early, allowing for optimal ad loading and rendering. Placing the script elsewhere can lead to delays or errors.

Premature Ad Display

  • Problem: Attempting to show an ad before it is ready can result in a poor user experience.
  • Solution: Always use the isReady() method to check if an ad is ready to be displayed before calling the show() method. This is a critical best practice. Calling show() before the ad is ready may lead to the ad not displaying or an error being thrown.

Interstitial Ad Frequency

  • Problem: Showing interstitial ads too frequently can be disruptive and annoying for users, leading to a negative experience.

  • Solution: Implement a time limit for interstitial ad displays. For example, interstitial ads should not be defined more frequently than every 120 seconds (2 minutes).

    • Initial Load: If an interstitial ad is defined when the page first loads, the second definition should be delayed until 120 seconds after the page has finished loading.
    • Subsequent Definitions: After the initial display, subsequent interstitial ad definitions should also adhere to the 120-second minimum interval.

By following these guidelines, you can ensure a smooth and effective ad integration, leading to optimal ad performance and a positive user experience.