Advertiser Integration
WeChat Mini-Program Tracking Integration

WeChat Mini-Program Tracking Integration

*Suggested brands use API Tracking Integrationd. When there are major feature iterations, Mini Program integration may require version compatibility.

The tracking integration method for WeChat Mini Programs involves capturing and storing the Tracking ID using JavaScript code. For events that need to be tracked, such as order submission or payment, JavaScript code is used to synchronize the conversion events (orders) with the Tracking ID information through Linkbest's API. Linkbest performs attribution processing based on the attribution factors associated with the Tracking ID.

Obtain Mini-Program code

To obtain the Mini-Program code, you need to first coordinate with the business team and provide them with your Mini-Program.

Integration Mini-Program code

Place the code snippet file in your Mini Program project, for example, create a new directory called "linkbest" and place the file inside it.

Add the "saveTrackingId" code snippet to the "onLoad" function of each page in your Mini Program, where "lbid" is the name of Linkbest's Tracking ID. For example:

import { linkbest } from './linkbest/utils';
 
onLoad(option){
    linkbest('saveTrackingId', option.lbid);
}

Add the "submit" code snippet to the "onLoad" function of the order confirmation page in your Mini Program, where "lbid" is the name of Linkbest's Tracking ID. For example:

import { linkbest } from './linkbest/utils';
onLoad(option){
   linkbest('submit', { 
         OrderId:'xxxx'
	...
	...
	...
   });
}

tracking data fields

Configuration required for WeChat Mini Programs integration

Due to the submission of tracking data to the Linkbest server during WeChat Mini Program code integration, you need to configure the Linkbest domain as a valid domain in your WeChat Mini Program settings. Otherwise, the API calls will not be successful. Please go to the WeChat Mini Program management platform -> Developer Settings -> Server Domain -> Add "https://api.linkbest.com (opens in a new tab)" to the "Request Domain" section.