0

Print Page ID on Landing page using AMPscript

I am in the process of creating a page to store information from customers who come to the landing page. I want to write it as follows, and I have had no issues storing other information in the Data Extension.

%%[

set @id = RequestParameter('userid')
set @SysDate = Now(1)
set @timestamp = SystemDateToLocalDate(@SysDate)
set @email = lookup("Customer Master Test","Email","UserId",@id)
set @phone = lookup("Customer Master Test","MobilePhone","UserId",@id)
set @country = lookup("Customer Master Test","Country","UserId",@id)

  
InsertData("Click_dataextension"
,"UserId",@id
,"EventType","Click"
,"ClickDate",@timestamp
,"Email",@email
,"MobilePhone",@phone
,"CountryCode",@country
,"PageID",%%_EmailID%%)

]%%

Additionally, I want to store the Page ID, and I tried putting %%_EmailID%% according to the attached post, but it didn't work. When I created a new page to see how %%_EmailID%% is displayed, it only appears as 0.

Landingpage Edit -> What I wrote

Preview -> preview

How can I find the Page ID of the page where the AMP script is written? (the same page)

1 Answer 1

0

I don't believe there's a Personalization String for it. As a workaround you can use PageURL, then have a DE that hosts the PageURL in one column, and the PageID in another column (all set up manually). Use a LookUp() to return the corresponding PageID for storing. (Or just insert the URL.)

PageURL is covered here: Get current location with AMPscript or SSJS

You must log in to answer this question.

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