Every click on your Baidu ads carries information. Which keyword triggered it? Which ad group? Which campaign? The answer to each question lives inside Baidu's platform — but getting it into your analytics system requires URL wildcards.
Baidu supports 9 active wildcard parameters that can be inserted into keyword landing page URLs, creative URLs, and mobile URLs. When a user clicks your ad, each wildcard is replaced with its corresponding value in real-time, allowing your analytics platform to attribute conversions back to the correct keywords, ad groups, and campaigns.
Here is a complete breakdown of every wildcard parameter, how to use them, and the best practices we have developed from managing millions of dollars in Baidu ad spend.
What Are Baidu URL Wildcards?
URL wildcards are placeholder parameters that Baidu automatically replaces with live values when an ad is clicked. Think of them as dynamic variables — you insert the placeholder into your landing page URL, and Baidu fills in the actual value at the moment of the click.
The basic concept is similar to Google Ads ValueTrack parameters, though the specific parameters and their behavior differ significantly. Baidu wildcards support tracking at every level of the account hierarchy — from the account ID down to the specific keyword variant.
URL wildcards work in keyword landing page URLs, creative (ad) landing page URLs, mobile URLs, and path sub-chains in additional creatives. They do not work in display URLs.
Complete Wildcard Reference
Here is every active wildcard parameter supported by Baidu search marketing, with its replacement value and typical use case.
| Parameter | Replaced With | Best For |
|---|---|---|
{userid} |
Account ID (globally unique) | Multi-account tracking |
{planid} |
Campaign ID (globally unique) | Campaign-level attribution |
{unitid} |
Ad group ID (globally unique) | Ad group performance |
{keywordid} |
Keyword ID (globally unique) | Keyword-level ROI tracking |
{creative} |
Creative (ad) ID | Ad copy testing |
{matchtype} |
1 = exact, 2 = phrase | Match type performance |
{dongtai} |
1 = dynamic ad, 0 = standard | Dynamic ad monitoring |
{crowdid} |
Audience package ID (0 = none) | Audience targeting validation |
{trig_flag} |
at / zx / nm | Traffic expansion tracking |
Keyword Encoding Parameters
Two additional parameters handle keyword encoding for landing pages that use different character encodings. This is critical for Chinese-language keywords.
| Parameter | Encoding | Example Output | Use When |
|---|---|---|---|
{kw_enc} |
GBK → URL-encoded | %CF%CA%BB%A8 |
Landing page uses GBK encoding |
{kw_enc_utf8} |
UTF-8 → URL-encoded | %E9%B2%9C%E8%8A%B1 |
Landing page uses UTF-8 encoding |
Baidu's default Chinese character encoding is GBK, not UTF-8. If your landing page uses UTF-8 (as most modern websites do), use {kw_enc_utf8} instead of {kw_enc}. Using the wrong encoding will produce garbled characters that break your analytics data.
How URL Wildcards Work: A Practical Example
Let's walk through a real scenario. Your original keyword landing page URL is:
http://www.yoursite.com
After adding several wildcard parameters, the URL becomes:
http://www.yoursite.com/?a_keywordid={keywordid}&a_creative={creative}&a_matchtype={matchtype}&a_dongtai={dongtai}
When a user clicks your ad, Baidu replaces each wildcard with its actual value. The resulting request sent to your server looks like:
http://www.yoursite.com/?a_keywordid=123456789&a_creative=98765432&a_matchtype=1&a_dongtai=0
Your analytics platform can now tell you exactly which keyword (ID 123456789) triggered the click, which creative (98765432) was shown, that it was an exact match (1), and that it was not a dynamic ad (0).
Combining Baidu Wildcards with Google UTM Parameters
If you use Google Analytics or another UTM-based analytics platform, the Baidu URL wildcard system works seamlessly alongside standard UTM parameters. You can mix them in the same URL:
https://www.yoursite.com/?utm_source=baidu&utm_medium=cpc&utm_campaign={planid}&utm_term={kw_enc_utf8}&utm_content={creative}
This approach gives you the best of both worlds — standardized UTM reporting in your analytics dashboard, combined with Baidu-specific tracking parameters that can be processed by your own server-side logic or a third-party attribution tool.
Always include {keywordid} and {planid} as a minimum baseline. These two parameters alone let you attribute conversions to the keyword and campaign level, which covers 90% of use cases.
Deprecated Wildcards (No Longer Supported)
Baidu has retired several wildcards as the platform evolved. If you see these in older account configurations, remove them — they no longer pass any value:
{pagenum}, {adposition}, {mediatype}, {placement}, {bidurl}, {haoci}, {abtest}
Using deprecated wildcards will not cause errors, but they will not populate any values either. This creates a false sense of tracking coverage — your analytics reports will show clicks with missing campaign data, which is worse than having no tracking at all.
7 Rules for Using URL Wildcards Correctly
- Wildcards are case-sensitive.
{Creative}does not work — use{creative}(all lowercase). Baidu performs no case normalization on parameter names. - Multiple identical wildcards repeat the same value. If you include
{keywordid}twice in the same URL, both instances will be replaced with the same keyword ID. - Invalid wildcards are silently ignored. If you submit a mistyped parameter, Baidu leaves it as plain text in the URL — no error message, no warning.
- Wildcards do not affect URL connectivity. Baidu does not validate whether the final URL is reachable. Ensure your landing page handles all possible parameter combinations.
- Display URLs do not support wildcards. They only work in landing page URLs, mobile URLs, and path sub-chains.
- Test with a single parameter first. Deploy one wildcard, verify it works in your analytics, then add more. Debugging 9 parameters at once is painful.
- Use query parameter prefixes. Instead of bare IDs (
?123), use named parameters (?kw_id=123). This prevents conflicts with other URL parameters.
Encoding Considerations for Chinese Keywords
One of the most common mistakes we see is choosing the wrong encoding parameter for Chinese keywords. The default Baidu encoding is GBK, but most modern landing pages use UTF-8. Using {kw_enc} on a UTF-8 landing page produces garbled, double-encoded characters that are useless for analytics.
Here is how to choose:
- Your landing page uses GBK: Use
{kw_enc}. After URL-decoding, the keyword will be in GBK format. - Your landing page uses UTF-8 (most common): Use
{kw_enc_utf8}. After URL-decoding, the keyword will be in UTF-8 format. - Not sure which encoding your landing page uses: Check the
<meta charset>tag in your page HTML. If it saysutf-8(orUTF-8), use{kw_enc_utf8}.
"Getting URL wildcards right is one of the highest-ROI technical changes you can make to a Baidu PPC account. Without proper tracking parameters, every optimization decision is based on guesswork."
— Baidu PPC Pro TeamAudience and Traffic Expansion Tracking
Two advanced parameters deserve special attention because they unlock insights that most advertisers miss:
{crowdid} — Audience Targeting Validation
When you target specific audience packages, {crowdid} returns the audience package ID that the clicked user matched, or 0 if no audience was matched. This is invaluable for verifying that your audience targeting is actually firing — you can compare the proportion of clicks with crowdid > 0 against your intended targeting coverage.
{trig_flag} — Traffic Expansion Monitoring
This parameter tells you whether a click came from automatic traffic expansion. It returns three possible values: at (automatic traffic expansion), zx (smart matching), or nm (normal traffic). If you are testing traffic expansion features, this parameter is essential for measuring the incremental value versus the cost.
📋 Key Takeaways
- Baidu supports 9 active URL wildcard parameters across the full account hierarchy
- Minimum recommended setup:
{keywordid}for keyword attribution +{planid}for campaign attribution - Combine Baidu wildcards with Google UTM parameters for dual-platform tracking
- Paired parameters are case-sensitive — always use lowercase
- Use
{kw_enc_utf8}for UTF-8 landing pages,{kw_enc}for GBK - Replace all 7 deprecated wildcards with active alternatives
- Test one parameter at a time to isolate configuration issues
Need Help Setting Up Baidu Tracking?
Our team has implemented URL wildcard tracking for hundreds of Baidu PPC accounts. We can audit your current setup, recommend the right parameters, and help you integrate with your analytics platform.
Talk to Our Team →