CampaignUrls

Contains the methods for managing the campaign's URLs. For more information, see URL Tracking with Upgraded URLs.

Methods

Method Name Return Type Description
clearTrackingTemplate void Removes the campaign's tracking template.
getCustomParameters Object Gets the campaign's custom parameters.
getTrackingTemplate string Gets the campaign's tracking template.
setCustomParameters(Object customParameters) void Sets the campaign's custom parameters.
setTrackingTemplate(String trackingTemplate) void Sets the campaign's tracking template.

clearTrackingTemplate

Removes the campaign's tracking template. For information about tracking templates, see Tracking Templates.

Returns

Type Description
void Returns nothing.

getCustomParameters

Gets the campaign'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 campaign'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.

getTrackingTemplate

Gets the campaign'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 campaign's tracking template.

setCustomParameters(Object customParameters)

Sets the campaign's custom parameters. Use this method if the final URL or tracking template include 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 campaign's existing custom parameters.

To clear the custom parameters from the campaign, pass an empty object (for example, setCustomParameters({})). To completely clear custom parameters, clear the parameters at all levels.

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 campaign. For example, {key1: 'value1', key2: 'value2', key3: 'value3'}, where key is the custom parameter's name 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.

setTrackingTemplate(string trackingTemplate)

Sets the campaign'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?

Arguments

Name Type Description
trackingTemplate string The tracking template to use with this campaign.

Returns

Type Description
void Returns nothing.