AmpScript. Correct use of CloudPagesURL and how to retrieve variables

Description of your first forum.
Post Reply
Abdur11
Posts: 29
Joined: Sun Dec 22, 2024 6:29 am

AmpScript. Correct use of CloudPagesURL and how to retrieve variables

Post by Abdur11 »

In Salesforce Marketing Cloud, CloudPageURL is an essential feature that allows you to add your CloudPages as a destination.



This feature is commonly used in emails to direct subscribers to specific pages . This article will walk you through the use of CloudPageURL , its structure, and how to combine it with other functions so that you don't run into any issues in Marketing Cloud.


CloudPageURL Function Structure



The CloudPageURL function is fairly straightforward and telegram filipina takes only one required parameter : the ID of the page you want to link to . This ID can be found in the parameters of each CloudPage page .



It also has optional fields for passing multiple variable-value pairs.



Here is the basic structure of the function:



< a href = «%%=CloudPagesURL(1234,'variable1′,'value1′,'variable2′,'value2′,…)=%%» > Visit a>



This code will generate a link to your CloudPage page with ID 1234.

Image

You can add as many variable-value pairs as you like, making it easy to customize your bindings.



Using RedirectTo and Concat



When you use CloudPageURL in your emails, you should be aware that this feature automatically adds certain parameters to URLs , such as tracking parameters. To avoid broken links, it is recommended to combine CloudPageURL with the RedirectTo and Concat functions . This creates a proper URL with all additional parameters and the correct separator:



<a href = «%%=RedirectTo(CONCAT(CloudPagesURL(1234),'?tema=marketing'))=%%» > Visit Page </a>



This way, you ensure that the generated links work correctly even in emails.



Pass Parameters



CloudPageURL also makes it easy to embed parameters in your links. You can follow the page ID with one or more comma-separated key-value pairs to pass parameters:



<a href = «%%=RedirectTo(CONCAT(CloudPagesURL(1234,'color','red')))=%%» > Visit Page </a>



A big benefit of this feature is that all parameters are automatically encoded, eliminating the need to encode them separately with Base64Encode or other methods.
Post Reply