0

I am sending an email to the DE below.

enter image description here

In the email i have a link which when clicked directs you to a cloudpage in marketing cloud.

For customers that click this link, i want to pass the Custno from the send DE into another DE which will contain the details of people who responded (Responses) along with the date when this clicked it.

enter image description here

Is the below correct?

In Cloud page

%%[

set @cno = RequestParameter('Custno')

set @date = Now(1)

UpdateDE("Responses",1,"Custno", @cno, "Customernumber", @cno, "Date clicked", @date)

]%% 

1 Answer 1

2

The UpdateDE() function's used to update records already in a Data Extension and it's really intended for use in sendable contexts, rather than CloudPages. You'd more likely want to add a record to the data extension when they click through or update, if there's already a response that's been recorded. This is what's called an "Upsert". You can use the UpsertData() function to achieve this.

Secondly, you're using the Now() function and passing in "1" for the PreserveSendTime parameter. This will provide the date and the time the email was sent to the subscriber and not the date and time they clicked through.

The link in your email to your CloudPage would look like this (please replace the ID of your CloudPage).

<a alias="CALL ME" href="%%=RedirectTo(Concat(CloudPagesURL(1234, 'Custno',Custno),'&'))=%%">

And the code in your CloudPage should look something like this:

%%[
set @cno = RequestParameter('Custno')
UpsertData('Responses',1,'Customernumber',@cno,'Date clicked',Now())
]%%
7
  • Is there anything to update for the <a href "cloudpage">callme </a> tag in the email? I got the 'date clicked' working but the 'Customernumber' didn't come through when i clicked on the link.
    – Rahul
    Aug 17, 2020 at 4:25
  • You don't give the anchor tag in your example. Could you provide so that I can understand what you've done. Your code assumes you're passing a query string parameter called "Custno" in the link.
    – Macca
    Aug 17, 2020 at 6:40
  • <strong><a href="cloud.email-novegy.co.nz/thanks " style="color:white;text-decoration:none;font-size:20px;">CALL ME</a></strong> I have this in my email which links to the cloud page.
    – Rahul
    Aug 17, 2020 at 20:49
  • Would there be a reason for CloudPagesURL not working. It spits out a 400 - Bad request error. i stripped the string parameter and used a very basic <a href="%%=CloudPagesURL(2755)=%%">click here to visit your landing page</a> with the correct cloud page Id and it spits a 400 - bad request. Can we query the string parameter with a url instead?
    – Rahul
    Aug 18, 2020 at 21:53
  • 1
    Do you have Web Analytics tagging set up in Parameter Manager? If so, you'll end up with two query strings appended to your CloudPageURL. You'll also need to do a RedirectTo() and make sure you're doing an actual send or test send, rather than clicking through from Send Preview. If there's an issue with encryption of QS params in your account (I've seen this a few times), try <a href="%%=RedirectTo(Concat(CloudPagesURL(2755),'&Custno=',Custno))=%%">
    – Macca
    Aug 19, 2020 at 1:18

You must log in to answer this question.

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