# ad-custom
Start from base library version 2.10.4. Please remaining backward compatible.
Native template Advertising.
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 | 2.10.4 | |
ad-intervals | number | no | Ad auto refresh interval, in seconds, must be greater than or equal to 30 template Ads won't automatically refresh) | 2.10.4 | |
bindload | eventhandle | no | Ad load successful callback | 2.10.4 | |
binderror | eventhandle | no | Callback for ad loading failure, event.detail = {errCode: 1002} | 2.10.4 |
# 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
tip
When displayed without advertisement,ad-custom
Labels will not take up heighttip
:ad-custom
Component does not support triggeringbindtap
Touch related eventstip
:: Currently availablead-custom
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 flowtip
After listening for error callbacks, 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 they will not receive the bindload callbacktip
Different templates involve different usage scenarios. Please refer to the template editor for details.