0

I am creating a cloudpage that will use AMPscript to update data of one data extension and insert in another. I was wondering how I could make sure that these functions would run.

So created the following block of code:

%%[
var @SubscriberKey, @InsertData, @UpdateData, @EmailAddress, @Language, @Country, @CouponCode
set @SubscriberKey = AttributeValue("SubscriberKey")
set @EmailAddress = AttributeValue("EmailAddress")
set @Language = AttributeValue("Language")
set @Country = AttributeValue("Country")
Set @CouponCode = AttributeValue("CouponCode")


set @InsertData = InsertData("Welcome_Email_TriggeredSendDE_Newsletter", "SubscriberKey", @SubscriberKey, ["EmailAddress", @EmailAddress], ["Language", @Language], ["Country", @Country], ["CouponCode", @CouponCode]

set @UpdateData = UpdateData("CommerceCloudSubscribers", 1, "SubscriberKey", @SubscriberKey, "DoubleOptin", "True")

]%%

How can I make sure that @InsertData and @UpdateDate will run when a subscriber will land on this page after clicking on a button from an email?

Thanks

2
  • Can you clarify what you mean. What is the current issue you are facing? What you have described appears to be a good general overview of what to do. Not sure what you are looking for assistance on? Nov 6, 2019 at 20:16
  • Im creating a welcome journey with two emails: email 1 is the 'verify your email address' and email 2 is a 'thank you for subscribing' email. In email 1, I will create a button that will link to a cloud page that contains the script here above. I was wondering how I could make sure that UpdateData and InsertData functions will run when a subscriber lands on the cloudpage. Do I need to create a runscript function somewhere in the page? Nov 7, 2019 at 8:26

1 Answer 1

0

I think what you are expecting is the below code. Use the below code in your email's CTA button.

Note: Make sure update below as per your requirement Page ID = 123 @x1, @x2, @x3, @x4, @x5 = as per your variables in Email

<a title="Some page" href="%%=RedirectTo(CloudPagesURL(123,'SubscriberKey',@x1,'EmailAddress',@x2,'Language',@x3,'Country',@x4,'CouponCode',@x5))=%%" alias="Some page">
Click to go there</a>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .