{Ifmobile} and {Ifnotmobile} ValueTrack Parameters


Two ValueTrack parameters are available to help advertisers manage cross-device campaign.The parameters are {ifmobile} and {ifnotmobile} and they are supported by Microsoft's Enhanced Campaigns and Yahoo! Japan's Unified Campaigns. These parameters can be used to send users to different landing pages, depending on whether they click on an ad from a mobile device or not.

Please note that after the Upgraded URLs migration Google uses the Mobile Landing Page field to determine whether a user is directed to a Mobile specific URL or not and not {ifmobile} and {ifnotmobile} parameters. For more information on Google's Upgraded URLs please see here.

How The {Ifmobile} And {Ifnotmobile} Parameters Work

The following is an example of how these parameters work in practice:

  • Mobile site: http://m.example.com
  • Non-mobile site: http://www.example.com
  • Example Keyword Destination URL: http://{ifmobile:m.}{ifnotmobile:www.}example.com

Users who click on an ad with this URL on a mobile device will be sent to http://m.example.com, and users who click from a tablet or desktop computer will be sent to http://www.example.com.

Using The {Ifmobile} And {Ifnotmobile} Parameters In The platform

Initial support for these parameters was added to the platform in the May 10th 2013 release. Users are now able to create Destination URLs (or Click Through URLs if using redirects) with these parameters and push these URLs to the publisher.

As of May 31st 2013, URLs with the {ifmobile}/{ifnotmobile} parameters will also be run through URL Builder and Autocorrect. This support is provided with the following notes:

  • Parameters will be appended to both Destination URLs (for non-redirects) and Click Through URLs (for redirects).
  • URL Builder will not run if there is a '?' or '&' inside an {ifmobile} or {ifnotmobile} expression. This is to avoid using the wrong delimiter or repeating parameters.

Examples where URL Builder will run:

  • http://{ifmobile:m.}{ifnotmobile:www.}example.com
  • http://{ifmobile:m.mobilesite.com}{ifnotmobile:www.desktopsite.com}

Examples where URL Builder will not run:

  • http://{ifmobile:m.mobilesite.com/?mobile=true}{ifnotmobile:www.desktopsite.com}
  • http://{ifnotmobile:mysite.com/home/?src=desktop}{ifmobile:m.example.com/?src=mob&id=2}

While required parameters will not be appended to Click Through URLs that contain query strings, we will still wrap these Click Through URLs in the base redirect and encode the Click Through URL appropriately.

We recommend putting as little text as possible within your {ifmobile}/{ifnotmobile} expressions. Common text should be factored outside to the main URL. Good and bad examples as follows:

  • Good: http://{ifmobile:m.}{ifnotmobile:www.}example.com
  • Bad: http://{ifmobile:m.example.com}{ifnotmobile:www.example.com}

Examples Of URL Building With The Parameter

Let's walk through a few basic examples to demonstrate how the platform's URL Builder works with {ifmobile}/{ifnotmobile} URLs.

Example 1: Non-Redirects

  • URL Builder Settings: mkwid=[uniq_id]&pcrid=[creative_id]&pkw=[keyword_text]&pmt=[matchtype]
  • Input URL: http://{ifmobile:m}{ifnotmobile:www}.example.com
  • Built URL: http://{ifmobile:m}{ifnotmobile:www}.example.com?mkwid=abcd1234&pcrid={creative}&pkw={keyword}&pmt={matchtype}

Example 2: Non-Redirects With Mobile Param In Middle Of URL

  • URL Builder Settings: mkwid=[uniq_id]&pcrid=[creative_id]&pkw=[keyword_text]&pmt=[matchtype]
  • Input URL: http://www.example.com{ifmobile:mobileView}{ifnotmobile:storeView}?exampleparam=10051
  • Built URL: http://www.example.com{ifmobile:mobileView}{ifnotmobile:storeView}?exampleparam=10051&mkwid=abcd1234&pcrid={creative}&pkw={keyword}&pmt={matchtype}

Example 3: Redirects

  • URL Builder Settings - Required Parameters: pub=[publisher]
  • URL Builder Settings - Base Redirect: http://track.com/rd?mkwid=[uniq_id]&pcrid=[creative_id]&lp=[click_through_url]
  • Input Click Through URL: http://{ifmobile:m.mobilesite.com/mob}{ifnotmobile:www.mysite.com/home}
  • Built URL: http://track.com/rd?mkwid=abcd1234&pcrid={creative}&lp=http%3A%2F%2F{ifmobile:m.mobilesite.com%2Fmob}{ifnotmobile:www.mysite.com%2Fhome}%3Fpub=microsoft

Note that special characters within {ifmobile} expressions are properly escaped within encoded Click Through URLs.

Example 4: Using {Ifmobile} Parameters In URL Builder Settings

  • URL Builder Settings: mkwid=[uniq_id]&mob={ifmobile:true}{ifnotmobile:false}
  • Input URL: http://{ifmobile:m.mobilesite.com}{ifnotmobile:www.desktopsite.com}
  • Built URL: http://{ifmobile:m.mobilesite.com}{ifnotmobile:www.desktopsite.com}?mkwid=abcd1234&mob={ifmobile:true}{ifnotmobile:false}

How To Test That The {Device} ValueTrack Parameter Is Resolving Correctly

Typically when a user searches and clicks on a paid search URL, Google would recognize the device a user is browsing from, and populate only the device-specific URL. Therefore, in order to see if the {ifmobile}{ifnotmobile} URLs are set up correctly, you would need to take these apart manually and load them as if they truly came from the mobile or non-mobile URL.

For example, if your URL is:


You could then update the URL to the following to verify that the URL is working as expected:

{ifmobile} URL

  • http://tracker.exampleone.com/rd?cid=test&mkwid={ifsearch:s}{ifcontent:c}test|d{device}&pcrid={creative}&pkw={keyword}&pmt={matchtype}&lp=http://m.exampletwo.com

{ifnotmobile} URL

  • http://tracker.exampleone.com/rd?cid=test&mkwid={ifsearch:s}{ifcontent:c}test|d{device}&pcrid={creative}&pkw={keyword}&pmt={matchtype}&lp=http://www.exampletwo.com

Please note: if you were to paste URLs containing {ifmobile}{ifnotmobile} as-is, it would be expected for this to not resolve correctly, since both of the {ifmobile}{ifnotmobile} values are included.

Important Notes

  • You can also use the {ifmobile} parameters within your URL Builder settings and/or directly within the values of your query string parameters. For example, if you want a parameter called mobile to equal true for mobile clicks and false for non-mobile clicks, you could do the following:
    • http://{ifmobile:m.}{ifnotmobile:www.}example.com/?mobile={ifmobile:true}{ifnotmobile:false}
  • Additionally, you can also use the {ifmobile} parameters in your Base Redirect URL if you require separate redirect URLs for mobile and non-mobile clicks. Example:
    • Base Redirect URL: http://track.com/rd?mkwid=[uniq_id]&pcrid=[creative_id]&device_type={ifmobile:mob}{ifnotmobile:nm}&lp=[click_through_url]

      Note that the {ifmobile} and {ifnotmobile} parameters can only be used after the start of the resource path (e.g. after the / in example.com/home)
  • It is not possible to use a secure protocol (https) for mobile clicks and non-secure protocol (http) for non-mobile clicks or vice-versa. The platform enforces validation to ensure all URLs with {ifmobile} / {ifnotmobile} begin with one unique protocol. This applies to both Destination URLs and Click Through URLs.
  • If the {ifmobile}{ifnotmobile} ValueTrack parameters are being used to split mobile traffic, please make sure tracking has been implemented correctly on the mobile landing/conversion pages too. Otherwise you may see fewer conversions being tracked. For example, for the Marin Tracker, please make sure pixels are deployed on the mobile pages.
  • Note for testing purposes: {ifmobile}{ifnotmobile} landing pages will not open when clicking on the Destination URL from the platform, or when copy/pasting the URL into a browser. This is because these parameters must first be resolved by the publisher (when clicking on the ad itself). If you need to, you can manually resolve the parameters yourself for testing purposes. For example, http://{ifmobile:m.}{ifnotmobile:www.}example.com would resolve into http://m.example.com OR http://www.example.com
  • Including pound signs '#' in your {ifmobile} / {ifnotmobile} URL's is not supported by URL Builder. If this is required, URL's will need to be manually appended with tracking.

Written by Marketing @ Marin Software

Last published at: January 10th, 2024