KeywordUrls

Contains the methods for managing the keyword's URLs, tracking template, and custom parameters. For information, see URL Tracking with Upgraded URLs.

Methods

Method Name Return Type Description
clearFinalUrl void Removes the keyword's final URL.
clearMobileFinalUrl void Removes the keyword's final URL for mobile devices.
clearTrackingTemplate void Removes the keyword's tracking template.
getCustomParameters Object Gets the keyword's custom parameters.
getFinalUrl string Gets the keyword's final URL.
getMobileFinalUrl string Gets the keyword's final URL for mobile devices.
getTrackingTemplate string Gets the keyword's tracking template.
setCustomParameters(Object customParameters) void Sets the keyword's custom parameters.
setFinalUrl(String finalUrl) void Sets the keyword's final URL.
setMobileFinalUrl(String finalUrl) void Sets the keyword's final URL for mobile.
setTrackingTemplate(String trackingTemplate) void Sets the keyword's tracking template.

clearFinalUrl

Removes the keyword's final URL.

Returns

Type Description
void Returns nothing.

clearMobileFinalUrl

Removes the keyword's final URL for mobile devices.

Returns

Type Description
void Returns nothing.

clearTrackingTemplate

Removes the keyword's tracking template.

Returns

Type Description
void Returns nothing.

getCustomParameters

Gets the keyword's custom parameters.

Custom parameters are helpful with sharing dynamic information across multiple URLs. For more information about its usage, see Custom Parameters.

Returns

Type Description
Object A map of the keyword's custom parameters.

For example, {key1: 'value1', key2: 'value2', key3: 'value3'}, where key is the name of the custom parameter and value is the parameter's value.

getFinalUrl

Gets the keyword's final URL. This is the URL of the webpage that the user is taken to when they click the ad.

The same override rules apply as elsewhere. For example, specifying a keyword's final URL overrides the ad's final URL.

Returns

Type Description
string The keyword's final URL.

getMobileFinalUrl

Gets the keyword's final URL for mobile devices. This is the URL of the mobile webpage that the user is taken to when they click the ad.

The same override rules apply as elsewhere. For example, specifying a keyword's mobile final URL overrides the ad's mobile final URL.

Returns

Type Description
string The keyword's final URL for mobile devices.

getTrackingTemplate

Gets the keyword's tracking template.

Tracking templates are used with the keyword's FinalUrl to create the destination URL used by the ad. For more information, see What tracking or URL parameters can I use?

Returns

Type Description
string The keyword's tracking template.

setCustomParameters(Object customParameters)

Sets the keyword's custom parameters. Use this method if the final URL or tracking template includes custom substitution strings.

To use a customer parameter name in the final URL or tracking template, enclose the name in curly braces and prepend an underscore (_) to the name. For example, if the parameter name is foo, use {_foo} in the tracking template or final URL. Do not add a leading underscore to the parameter name when defining the custom parameters object.

Calling this method replaces the keyword's existing custom parameters.

To clear the custom parameters from the keyword, pass an empty object (for example, setCustomParameters({})). If you clear the keyword's custom parameters, the keyword inherits the URLs from its parent ad group (if the ad group specifies URLs). To completely clear custom parameters, clear them at all levels in the hierarchy.

Custom parameters are helpful with sharing dynamic information across multiple URLs. For more information about its usage, see Custom Parameters.

Arguments

Name Type Description
customParameters Object A map of up to three custom parameters to use in the keyword. For example, {key1: 'value1', key2: 'value2', key3: 'value3'}, where key is the name of the custom parameter and value is the parameter's value. The parameter's name may contain only alphanumeric characters and the parameter's value may not contain white space. The name may contain a maximum of 16 8-byte characters and the value may contain a maximum of 200 8-byte characters.

Returns

Type Description
void Returns nothing.

setFinalUrl(String finalUrl)

Sets the keyword's final URL.

The final URL identifies the webpage that the user is taken to when they click the ad. If not specified, the entity inherits the final URL from its parent entity. For example, the keyword entity inherits the ad's final URL. Specify the keyword's final URL to override the ad's final URL.

For more information, see What tracking or URL parameters can I use?

If the property's value is not valid, the call silently fails. To confirm whether the property was actually updated, get the object again and test whether the property's value equals the new value. For information, see Handling errors and warnings.

Arguments

Name Type Description
finalUrl string The keyword's final URL.

Returns

Type Description
void Returns nothing.

setMobileFinalUrl(String finalUrl)

Sets the keyword's final URL for mobile devices.

The final URL identifies the webpage that the user is taken to when they click the ad. If not specified, the entity inherits the final URL from its parent entity. For example, the keyword entity inherits the ad's final URL. Specify the keyword's final URL to override the ad's final URL.

For more information, see What tracking or URL parameters can I use?

To specify a final URL for mobile devices, first specify a final URL for non-mobile devices (see setFinalUrl()).

If the property's value is not valid, the call silently fails. To confirm whether the property was actually updated, get the object again and test whether the property's value equals the new value. For information, see Handling errors and warnings.

Arguments

Name Type Description
finalUrl string The keyword's final URL mobile devices.

Returns

Type Description
void Returns nothing.

setTrackingTemplate(String trackingTemplate)

Sets the keyword's tracking template.

Tracking templates are used with the keyword's FinalUrl to create the destination URL used by the ad. For more information, see What tracking or URL parameters can I use?

If the property's value that's not valid, the call silently fails. To confirm whether the property was actually updated, get the object again and test whether the property's value equals the new value. For information, see Handling errors and warnings.

Arguments

Name Type Description
trackingTemplate string The keyword's tracking template.

Returns

Type Description
void Returns nothing.