Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program open data ad


May 18, 2021 WeChat Mini Program Development Document


Table of contents


ad

Base library 1.9.94 starts to support, and low versions need to be compatible.

Banner ads.

Property Type The default Required Description The lowest version
unit-id string Is Ad unit id, which can be created in the main module of traffic behind the scenes for small program management 1.9.94
ad-intervals number Whether The interval between automatic ad refreshes, in seconds, and the parameter value must be greater than or equal to 30 (Banner ads do not automatically refresh when the parameter is not passed in) 2.3.1
bindload eventhandle Whether The ad loads a successful callback 2.2.1
binderror eventhandle Whether Callbacks to ad load failure, event.detail . 2.2.1
bindclose eventhandle Whether Callbacks for ad shutdown 2.6.5

Error code information and solution table

The error code is an error message obtained through the binderror callback.

Code Abnormal condition Reason Solution
1000 The back-end error call failed This error is not an exception for the developer In general, you can recover by ignoring it for a period of time.
1001 The argument is wrong The method used is wrong You can go developers.weixin.qq.com to confirm specific tutorials (small programs and games have their own tutorials) and you can switch between the top options, to the right of the Design column.
1002 The ad unit is not valid It could be a misspelling or a misuse of another APP's ad ID Please go back to mp.weixin.qq.com confirm your ad bit ID.
1003 Internal error This error is not an exception for the developer Under normal circumstances, it can be restored for a period of time.
1004 Uncomplete advertising Advertising is not every time, this time has not appeared because the user is not suitable for browsing ads. It is normal, and developers need to be compatible with this situation.
1005 Advertising component audit Your advertisement is being reviewed and cannot show advertising. Please go to mp.weixin.qq.com to confirm the review status, and developers need to be compatible with this situation.
1006 Advertising components are dismissed Your advertising failed, unable to show advertising Please go to mp.weixin.qq.com to confirm the review status, and developers need to be compatible with this situation.
1007 Advertising components are dismissed Your advertising capacity has been banned, and advertisements cannot be displayed during the ban. Please go to mp.weixin.qq.com to confirm the small program advertising.
1008 The ad unit is turned off The advertising capabilities of this ad space have been turned off Go to mp.weixin.qq.com to reopen the display of the corresponding ad space.

Tips:

  1. Ad tags don't take up height when there's no ad display
  2. The ad component does not support triggering touch-related events such as bindtap
  3. You can now set the wxss style for the ad tag to adjust the width of your ad to make your ad more harmonious with your page, but follow the main app specification for small program traffic
  4. After listening to the error callback, developers can target processing, such as hiding the parent container of the ad component to ensure the user experience, but do not remove the ad component, otherwise they will not receive the bindload callback.