# Advertising preload interface
Base library 2.14.1 Start support, low version needs to doCompatible processing
In the Mini Program environment, support is provided by calling thewx.preloadAdInterface, load advertising data in advance, and then create corresponding advertising labelsad,ad-customThe preloaded ad data is automatically used, eliminating the time it takes to pull the ad again when creating an ad label.
# Preload example
wx.preloadAd([{
unitId: 'adunit-XXX', // Native Template Advertising Ad Unit
type: 'custom' // Native Template Advertising
},
{
unitId: 'adunit-XXX', // Banner advertising unit
type: 'banner' // BannerAdvertising
},
{
unitId: 'adunit-XXX', // Front Post Advertising Unit
type: 'videoPatch' // Advertising before video
},
{
unitId: 'adunit-XXX', // Video Advertising Ad Unit
type: 'video' // Video advertising
}
])
# wx.preloadAd(Array object)
# object parameter
attribute | type | Default value | Required | Introductions |
---|---|---|---|---|
unitId | string | nothing | yes | The ad unit ID can be created in the main traffic module of the Mini Program management background |
type | string | nothing | yes | Advertising unit belongs to the type of advertising space custom Native Template Advertising Banner BannerAdvertisingvideoPatch Advertising before video video Video advertising |
# Note
1, whether the preload is successful has no perception of the developer, and the use of advertising is consistent with no preload.
2, the advertising unit id and the advertising unit belongs to the advertising type need to match successfully, otherwise it will lead to the normal use of preloaded data.
3, in the appropriate scene to use the preload interface (such as pageA call preload, pageB call advertising display, pageA jump pageB), leaving enough time to interface calls and advertising label creation to reflect the advantages of preload.
4, if there is a need to display ads in the home page, and the subsequent ads have no new, refresh and other logic, no need to call preload.
5, if you need to display ads in the home page, there are new, refresh logic, you can call the preloaded interface in apagejs.
6, the advertising unit preloaded, will bring MP backstage advertising data pull volume growth, there may be decreased exposure phenomenon. It is suggested that developers should pay attention to the variation of the absolute value of exposure.