0

Currently I'm fetching the Clicks for a landing page into a DE,

=== Email to fetch subscriber key ====

Hi,<br>
<br>
%%[SET @Sub = _subscriberkey SET @ClickPage = concat('https://fe91137376640d7a74.pub.s7.sfmc-content.com/o0tkjefs5c4?sub=',@Sub)]%% We are tracking landing pages, Please&nbsp;<a alias="" conversion="false" data-linkto="https://" href="%%=RedirectTo(@ClickPage)=%%" style="color:#1010EE;text-decoration:none;" title="">Click Here</a>

==== Landing Page =====

<html>
<head>
 <meta charset="utf-8">
 <title>My Landing Page</title>

%%[ 



set @Subs = RequestParameter('sub')
 set @JobId = RequestParameter('ji')
 set @memberid = RequestParameter("memberid")

 InsertData('Page Visits','Subscriber Key', @Subs,'jobid', @jobid,'memberid', @memberid, 'Event Date', SystemDateToLocalDate(Now()))

 ]%%

</head>
<body>

<h1>Thanks for visiting!</h1>
</body>
</html>

The above code is working good, IF I add JOB ID in the email, which is not tracking the Job Id (below code)

==== Email to fetch JobID ====

Hi,<br>
<br>
%%[SET @Sub = _subscriberkey
SET @JID = JobId
SET @ClickPage = concat('https://fe91137376640d7a74.pub.s7.sfmc-content.com/o0tkjefs5c4?sub=',@Sub,'?ji=',@JID)]%% We are tracking landing pages, Please&nbsp;<a alias="" conversion="false" data-linkto="https://" href="%%=RedirectTo(@ClickPage)=%%" style="color:#1010EE;text-decoration:none;" title="">Click Here</a>

Is there anything I'm missing in the JOB ID email Code?

Thanks in advance

1

1 Answer 1

3

As @zuzannamj stated in comments. Your solution is to utilize the CloudPagesURL() function in AMPscript.

Basically it would change your 'email code' to:

Hi,<br>
<br>
%%[
  SET @Sub = _subscriberkey 
  SET @CloudPageID = 12345 /* Replace with your CP ID */
]%% 
We are tracking landing pages, Please&nbsp;<a alias="" conversion="false" data-linkto="https://" href="%%=RedirectTo(CloudPagesURL(@CloudPageID))=%%" style="color:#1010EE;text-decoration:none;" title="">Click Here</a>

Then inside the CloudPage you would adjust your code to:

<html>
<head>
 <meta charset="utf-8">
 <title>My Landing Page</title>

%%[ 



set @Subs = AttributeValue('_SubscriberKey')
 set @JobId = AttributeValue('jobID')
 set @memberid = AttributeValue("memberid")

 InsertData('Page Visits','Subscriber Key', @Subs,'jobid', @jobid,'memberid', @memberid, 'Event Date', SystemDateToLocalDate(Now()))

 ]%%

Note, that to get the CloudPage ID you need to collect this inside the UI. This is the only place that you can gather this ID. There is no API or other public way to gather this info.

</head>
<body>

<h1>Thanks for visiting!</h1>
</body>
</html>

Note that the Cloud Page ID is only available in the UI. There is no API or other public way to gather this information.

1
  • Thanks a Lot @Gotonington , Given is working :)
    – kiran
    Mar 4, 2020 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.