You add URL parameters to your destination URL or tracking template to find out how visitors got to your website. URL parameters allow you to track information about the source of an ad click.
Although the variable names and the parameters can change, the structure is always the same:
Putting it all together, it looks like this:
www.yourLandingPageURL.com?variable={parameter}
If you are adding more than one variable={parameter}, you separate the variable/parameter pair with an ampersand (&).{CampaignId} | |
---|---|
What it returns: The ID of the campaign that triggered the ad. For example, suppose your destination URL is www.northwindtraders.com/{CampaignId}. Assuming that your campaign ID is 2410012280, the destination URL will be www.northwindtraders.com/2410012280. | |
{Campaign} | |
What it returns The name of the campaign that triggered the ad. For example, suppose your destination URL is www.northwindtraders.com/{Campaign}. Assuming that your campaign name is Sale, the destination URL will be www.northwindtraders.com/Sale. | |
{AdGroupId} | |
What it returns The ID of the ad group that triggered the ad. For example, suppose your destination URL is www.northwindtraders.com/{AdGroupId}. Assuming that your ad group ID is 2410012280, the destination URL will be www.northwindtraders.com/2410012280. | |
{AdGroup} | |
What it returns The name of the ad group that triggered the ad. For example, suppose your destination URL is www.northwindtraders.com/{AdGroup}. Assuming that your ad group ID is Clearance, the destination URL will be www.northwindtraders.com/Clearance. | |
{TargetId} | |
What it returns The ID of the keyword ("kwd"), remarketing or audience list ("aud"), dynamic ad target ("dat"), product partition ("pla"), or targeted location ID ("loc") that triggered the ad. If there are more than one ID, they will appear in the following order: aud, dat, kwd, pla. For example, if you associate remarketing list "1234" with keyword "5678", the {TargetId} would be replaced by "aud-1234:kwd-5678". Note: In-market audiences and LinkedIn profile targeting cannot be tracked through this parameter as this would expose individual user behavior on Bing and other Microsoft properties. | |
{MatchType} | |
What it returns The match type used to deliver an ad. This can be different from the {BidMatchType}. For example, if you bid on a broad match and the search term was an exact match. This can help you determine what match types are getting the most clicks.
| |
{BidMatchType} | |
What it returns The keyword bid match type. This can be different than {MatchType}. For example, if you bid on a broad match and the search term was an exact match. When used with {MatchType} this can help you refine your bidding, keyword and landing page strategies.
| |
{Network} | |
What it returns The ad network type on which the ad was served.
| |
{Device} | |
What it returns One of the following codes depending on where the click came from. This list can help you determine what type of devices are generating the most clicks. You can then customize your ads and bids accordingly.
| |
{IfMobile:string} | |
What it returns The string text (that you define) to the right of the colon if the ad is displayed on a mobile device. For example, if your parameter was {IfMobile:adDisplayedOnMobile} and your ad was displayed on a mobile device, your server log would receive adDisplayedOnMobile. | |
{IfNotMobile:string} | |
What it returns The string text (that you define) to the right of the colon if the ad is displayed on a desktop, laptop, or tablet device. For example, if your parameter looked like this: {IfNotMobile:adNotOnMobile} and your ad was displayed on a mobile device, your server log would receive: adNotOnMobile. | |
{IfSearch:string} | |
What it returns The string text (that you define) to the right of the colon if the ad is displayed on the search network. For example, if your parameter looked like this: {IfSearch:adDisplayedOnSearch} and your ad was displayed on the search network, your server log would receive: adDisplayedOnSearch. | |
{IfNative:string} | |
What it returns The string text (that you define) to the right of the colon will be substituted into the URL if the ad is displayed as a Microsoft Audience Ad. For example, if your parameter looked like this: {IfNative:nativeAd} and your ad was displayed as an audience ad, your server log would receive: nativeAd. | |
{IfPLA:string} | |
What it returns The string text (that you define) to the right of the colon will be substituted into the URL if the ad is displayed as a product ad. For example, if your parameter looked like this: {IfPLA:productAd} and your ad was displayed as a product ad, your server log would receive: productAd. | |
{AdId} | |
What it returns The numeric ID of the displayed ad. You can get your ad ID on the Ads table on the Campaigns page. If the Ad ID column is not displayed in the table, click Columns and select Ad ID. Then click OK. | |
{keyword:default} | |
What it returns Substitutes the keyword that matched the user's search term. Spaces in the keyword will each be substituted with "%20" to ensure the URL is valid. Note: You should provide a default string that the system will use if including the substitution value will cause the expanded string to exceed the string limit of the URL. Substitution of your default text is not supported, so you should not include characters such as a space which would cause the URL to be invalid. | |
{msclkid} | |
What it returns A unique ClickID for the clicks on the ad. To learn more, see Description of methodology | |
{OrderItemId} | |
What it returns The numeric ID for the keyword that triggered the display of your ad. For shopping campaigns, {OrderItemId} will return the product group ID. | |
{param1:default} | |
What it returns Substitutes {Param1} in the URL with the Param1 setting of the keyword that matched the user's search term. Note: You should provide a default string that the system will use if including the substitution value will cause the expanded string to exceed the string limit of the URL. | |
{param2:default} | |
What it returns Substitutes {Param2} in the URL with the Param2 setting of the keyword that matched the user's search term. Note: You should provide a default string that the system will use if including the substitution value will cause the expanded string to exceed the string limit of the URL. | |
{param3:default} | |
What it returns Substitutes {Param3} in the URL with the Param3 setting of the keyword that matched the user's search term. Note: You should provide a default string that the system will use if including the substitution value will cause the expanded string to exceed the string limit of the URL. | |
{QueryString} | |
What it returns The search query text that the user entered. | |
{copy:queryparameter} | |
{copy} parameter doesn't work with final URLs but it does work with destination URLs. When an ad with an app extension, Image ad extension or sitelink extension is served, the {copy} string in the ad extension's destination URL is replaced with the specified query parameter from the ad's resolved destination URL. The resolved destination URL is the URL used by the ad at the time the ad is served; after all dynamic text strings in the ad's destination URL are substituted with actual values. For example, if a sitelink extensions's destination URL contains {copy:myId} and the ad's resolved destination URL includes ?myId=123, the {copy:myId} string will be replaced with myId=123. If the ad's resolved destination URL does not include the query parameter, the {copy} string will be replaced with the name portion of the query parameter. For example, myId=. NoteIf you have upgraded your keyword destination URLs to final URL but haven't upgraded your sitelink extension URLs yet, the {copy} parameter will still work for the sitelink extension. For example: Keyword Final URL (upgraded): http://www.example.com?a=1&b=desk Keyword Mobile URL (upgraded): http://www.example.com?a=1&b=mob Sitelink Extension URL (not upgraded): http://www.example.com?a=1&{copy:b} | |
{feeditemid} | |
What it returns The ID of the ad extension that was clicked. | |
{loc_physical_ms} | |
What it returns The geographical location code of the physical location of the click. For more information on geographical location codes, take a look at this Bing Ads API doc. | |
{loc_interest_ms} | |
What it returns The geographical location code of the location of interest that triggered the ad. For more information on geographical location codes, take a look at this Bing Ads API doc |
Custom parameters will return the variable if added to a tracking template but will return an empty value if added to a destination URL.
Tracking templates should include a parameter that inserts your landing page URL using either the {lpurl} or other advanced parameters. Once your ad is clicked, these parameters will insert your final URL. If you don’t include a URL insertion parameter in your tracking template, your landing page URL will break.
{lpurl} Basic setup | ||||||
---|---|---|---|---|---|---|
When to use: You track your tags on the actual landing page. Tracking template structure:{lpurl}, a question mark, and then any parameters Example:
| ||||||
{lpurl} 1 redirect and parameters | ||||||
When to use: You have 1 redirect to a tracking website and want to send parameters to it. Tracking template structure:Redirect URL, a question mark, url={lpurl}, an ampersand, and then any parameters Example:
| ||||||
{lpurl} 1 redirect and landing page parameters (tracking template) | ||||||
When to use: You have 1 redirect to a tracking website and want to send parameters to your landing page using a tracking template. Tracking template structure:Redirect URL, a question mark, url={lpurl}, %3F, %26, and then any parameters Since {lpurl} is not at the beginning of the tracking template, you need to add %3F after {lpurl} instead of a question mark. You also need to replace the ampersand (&) with %26. Example:
| ||||||
{lpurl} 1 redirect and landing page parameters (no tracking template) | ||||||
When to use: You have 1 redirect to a tracking website and want to send parameters to your landing page without using a tracking template. Tracking template structure:Redirect URL, a question mark, url={lpurl} Best to store landing page parameters in the final URL when using a redirect URL so that Bing does all the encoding inside {lpurl} when evaluating the tracking template. Example:
|
We recommend that you put the {lpurl} at the beginning of the tracking template. If you don't, the final URL will be escaped. All characters that are not letters, numbers, or the following punctuation characters will be escaped: -, _, ., !, *, (, and ).
Parameter | What it returns | ||||||
---|---|---|---|---|---|---|---|
{lpurl+2} |
The Final URL escaped twice. Also known as double encoding. You use this when you have 2 redirects before reaching the landing page.
| ||||||
{lpurl+3} |
The Final URL, escaped three times. Also known as triple encoding. You use this when you have 3 redirects before reaching the landing page.
| ||||||
{unescapedlpurl} | The Final URL, unescaped. | ||||||
{escapedlpurl} | The Final URL, escaped. Escapes all characters that are not letters, numbers, or the following punctuation characters: -, _, ., !, *, (, and ). | ||||||
{escapedlpurl+2} | The Final URL, escaped twice. Useful when you have a chain of redirects. | ||||||
{escapedlpurl+3} | The Final URL, escaped three times. Useful when you have a chain of redirects. |
As seen in the examples above, what you add after the URL insertion parameter is dependent on where in the tracking template you place it. You will want to adhere to the following rules or your website/third-party system may not properly save the information from your URL parameters.
Parameter | Tracking template location | Followed by | Example |
---|---|---|---|
{lpurl} | Beginning | ? | {lpurl}? |
{lpurl} | Not at the beginning | %3F | {lpurl}%3F |
{lpurl+2} | Not at the beginning | %253F | {lpurl+2}%253F |
{lpurl+3} | Not at the beginning | %25253F | {lpurl+3}%25253F |
{unescapedlpurl} | Anywhere | ? | {unescapedlpurl}? |
{escapedlpurl} | Anywhere | %3F | {escapedlpurl}%3F |
{escapedlpurl+2} | Anywhere | %253F | {escapedlpurl+2}%253F |
{escapedlpurl+3} | Anywhere | %25253F | {escapedlpurl+2}%253F |
Microsoft Advertising will replace the question mark in your tracking template with an ampersand or a correctly escaped version of an ampersand if your final URL already contains a question mark.
Parameter | What it returns |
---|---|
{ignore} |
Ignores the tracking elements of your Final URL to help to reduce the crawl load on your website. It can only be used in your Final or Final mobile URL. For example, if your Final URL is http://www.example.com/product?p1=a&/p2=b&p3=c&p4=d, and the tracking info following the question mark in the URL doesn’t change the landing page, you can insert {ignore} before your tracking info to indicate that everything after it is merely tracking info. Here’s an example of how to do this: http://www.example.com/product?{ignore}p1=a&p2=b&p3=c&p4=d |
Here are some things to bear in mind when using {ignore}
If you advertise with product ads in your Microsoft Shopping Campaigns, the DestinationUrl of a BiddableAdGroupCriterion can include the following dynamic text strings. The strings are case-insensitive and must include the opening and closing braces.
Parameter | What it returns |
---|---|
{CriterionId} | The identifier of the Microsoft Shopping product group used with product ads. Note: For shopping campaigns, {CriterionId} is the same as {OrderItemId}. |
{OrderItemId} | The identifier of the Microsoft Shopping product group used with product ads. Note: For shopping campaigns, {OrderItemId} is the same as {CriterionId}. |
{product_channel} | The type of shopping channel (online or local) that the product in the clicked ad is sold. |
{product_country} | The country of sale for the product in the clicked ad. For example, US, UK, etc. |
{ProductId} | The numeric ID of the product that triggered your ad. This comes from your Microsoft Merchant Center catalog and is used with product ads. |
{product_language} | The language of your product information, as indicated in your Merchant Center data feed. For example, EN, FR. |
{seller_name} | The value associated with the seller for that product, which can be the seller name from the feed or the store name based on if the advertiser is an aggregator or not. |