# ad

Start from base library version 1.9.94. Please remaining backward compatible.

Banner ad.

attribute type Default value Required Introductions Minimum version
unit-id string yes Ad unit id, available in theMini Program management background traffic main module new 1.9.94
ad-intervals number no Ad auto refresh interval, in seconds, must be greater than or equal to 30 Banner Ads won't automatically refresh) 2.3.1
ad-type string banner no Advertising type, default to display banner, can be obtained by setting this property tovideoDisplay video ads, gridFor Plaid Advertising 2.8.0
ad-theme string white no 2.8.0
bindload eventhandle no Ad load successful callback 2.2.1
binderror eventhandle no Callback for ad loading failure, event.detail = {errCode: 1002} 2.2.1
bindclose eventhandle no Callbacks to ad shuts down 2.6.5

# Error Code Information and Solution Table

The error code is the error message that is retrieved by the binderror callback.

code Abnormal situation reason Solution
1000 Backend error call failed This error is not a developer anomaly Generally ignored for a period of time to recover.
1001 Parameter error Use Method Error You can go to developers.wechat.qq.com to confirm the tutorial (there are tutorials for Mini Programs and games, and you can switch from the top option to the right of the "Design" column.
1002 Invalid advertising unit May be a typo, or misuse of another app advertising ID Please go back to mp.wechat.qq.com to confirm your ad spot ID.
1003 Internal error This error is not a developer anomaly Generally ignored for a period of time to recover.
1004 No suitable advertising Ads don't appear every time. This one may be because the user is not suitable for viewing ads This is normal, and developers need to be morphologically compatible for this situation.
1005 Advertising component audit Your ad is being reviewed and cannot be displayed. Please go to mp.wechat.qq.com to confirm the audit status, and developers need to make morphological compatibility for this situation.
1006 Advertising components rejected Your ad review failed to show the ad Please go to mp.wechat.qq.com to confirm the audit status, and developers need to make morphological compatibility for this situation.
1007 Advertising components rejected Your ability to advertise has been banned and cannot be displayed during the ban. Please go to mp.wechat.qq.com to confirm the status of Mini Programs Advertising Ban.
1008 Ad unit closed The advertising capacity of the ad space has been shut down Please go to mp.wechat.qq.com to reopen the display of the corresponding ad space.

# Bug & Tip

  1. tipWhen displayed without advertisement,to Labels will not take up height
  2. tipto Component does not support triggering bindtap Touch related events
  3. tip:: Currently available to Label Settings wxss Styles adjust the width of the ad to make the ad more compatible with the page, but followMaster application specification for Mini Program flow
  4. tipAfter listening to the error callback, developers can do something targeted, such as hiding the parent container of the ad component to ensure user experience, but do not remove the ad components, otherwise you will not receive the bindload callback.