Customize your ads to show specific text based on what potential customers are searching for by using IF functions. IF functions are specific parameters that are used in responsive search ads for the search network; so, when a person is searching for something and the conditions are met, the parameter is replaced by the text you specify.
Below, you can learn how to add IF functions to your responsive search ad, how to create an IF function manually, and how to escape special characters with backslashes (\).
You cannot create new expanded text ads with IF functions, but your existing expanded text ads with IF functions will continue to serve. For more information, see How to create or edit expanded text ads.
Here are the supported targets for IF functions, with the syntax you'll need to enter directly in the ads field:
Target | Value | Syntax | How it appears |
---|---|---|---|
Device | Mobile | {=IF (device = mobile, text to insert): default text} | If the user is on a mobile device, the entire IF function is replaced with the value in “text to insert”. Otherwise, the “default text” that is provided will be used. Learn more about targeting. |
Audience | Any valid audience list name | {=IF (audience IN (<audience list 1>, <audience list 2>), text to insert): default text} | If the user is in audience list 1 or audience list 2, the IF function is replaced with the “text to insert”. Otherwise, the “default text” that is provided will be used. Learn more about audience options. |
IF functions are encased in brackets and inserted anywhere into a responsive search ad, except for the URL fields.
If you want to target by Audience, select Audience from the If dropdown menu, then select the audience list to target. We recommend that you add text in Otherwise (optional) for text to appear in case the end-user doesn't belong to any of the selected audience lists. This ensures that your ad always serves.
Microsoft Advertising | Bing Search |
---|---|
Headline 1: Contoso Shoes Headline 2: Summer Sale Going On Now Headline 3: Best Selections Available Description: Check Out The Best Selection Of Shoes. {=IF (device = mobile,Free Delivery with Mobile Orders!): Free Delivery!} |
Mobile
Desktop
|
Headline 1: Contoso Jewelry Headline 2: Find {=IF(audience in(/Apparel&Accessories), Best Selection Of Women’s Jewelry): Women’s Jewelry} Here Headline 3: Best Prices Available Description: Find The Perfect Piece Of Jewelry To Treat Yourself! |
Audience = Apparal&Accessories Other audiences |
You can create an IF function manually by typing directly in the Create ad input boxes, by using a bulk upload spreadsheet, or by using Microsoft Advertising Editor. To ensure that you enter it correctly, here's an example of the IF function's components:
{=IF (device = mobile,Free Delivery with Mobile Orders!): Free Delivery!}Component | What you need to know |
---|---|
{ ... } | Mandatory. The entire IF function syntax must be within a pair of braces (also called curly brackets). |
=IF | Mandatory. This component needs to be met so that the text defined in the Then insert box can appear in your title, path, or ad text fields. |
( ... ) | Mandatory. The other components of the syntax must be within a pair of parentheses. Note: Individual components within the parentheses must be separated by commas. |
"device" | If the user is on a mobile device, the entire IF function is replaced with the value in “text to insert”. Otherwise, the “default text” that is provided will be used. |
"Free Delivery with Mobile Orders!" | If the user is on a mobile device, the entire IF function is replaced with the value in “text to insert”. Otherwise, the “default text” that is provided will be used. |
"Free Delivery!" | Optional: This is the text that will appear in your title, path, or ad text field if the IF function isn't met. |
Component | What you need to know |
---|---|
{ ... } | Mandatory. The entire IF function syntax must be within a pair of braces (also called curly brackets). |
=IF | Mandatory. This component needs to be met so that the text defined in the Then insert box can appear in your title, path, or ad text fields. |
( ... ) | Mandatory. The other components of the syntax must be within a pair of parentheses. Note: Individual components within the parentheses must be separated by commas. |
"audience in(/Apparel&AccessoriesAccessories)" | If the user is on an audience list, the entire IF function is replaced with the value in “text to insert”. Otherwise, the “default text” that is provided will be used. |
"Women's Jewelry" | This is the text that will appear in your title, path, or ad text fields if the IF function conditions are met (must be within a pair of double quotation marks). |
"Best Selection of Women's Jewelry" | Optional: This is the text that will appear in your title, path, or ad text field if the IF function isn't met. |
Certain special characters used in an audience name or in the text field can break the syntax, so you'll want to use backslashes (\) to escape the special characters. Below are the rules if these characters are referenced in the IF function syntax.
Syntax field | Characters to escape | Example | System will detect as |
---|---|---|---|
Audience name | ) and , | {=IF(audience IN (Audiencelist\)te\,st),Insert text):Default text } | Audience name = Audiencelist)te,st |
Insert text | ) | {=IF(audience IN (Audience list),Insert \)text):Default text } | Insert text = Insert )text |
Default text | } | {=IF(device = mobile, Insert Text):Default\}text} | Default text = Default }text |
All fields | \ | {=IF(audience IN (Audience\\list),Insert text):Default text } | Audience name = Audience\list |