1

I'm trying to figure out how to pass a coupon value to a Cloud Page from an email deployed via SFMC. I'm definitely a neophyte when it comes to this stuff, but this can't be that hard?!?!

After reading the online documentation I figured I would use a combination of a PURL and AMPscript as I'm comfortable with AMPscript

For whatever reason I can't get the coupon code to display. I've tried the following in the cloud page:

%%[ SET @couponID = LookUp("Coupons","CouponCode","EmailAddress",emailaddr) ]%%
    %%=v(@couponID)=%%

and in the email, I have the cloud page URL with the appropriate URL string:

?emailaddress=%%emailaddr%%  

The Coupon Code is definitely populating into the email, I just can't get it to display on the Cloud Landing Page. I know there's a SSJS way to do this, but I don't know SSJS.

2

Your major issue is that the emailaddr is blank, so your lookup will fail. I would not recommend using the string emailaddr is outside of email creatives.

You are using a parameter to pass the value, so you would need to request this parameter and then set the variable in your lookup.

See below:

 %%=[  
      SET @EmailAddress = RequestParameter("emailaddress")
      SET @coupoonID = LookUp("Coupons", "CouponCode", "EmailAddress", @EmailAddress)
  ]%%
  • This is exactly what I needed. Thank you. It's always a simple oversight, isn't it? – George Rosedale Mar 17 '17 at 15:03
  • Glad to have helped! If you feel this has solved your issue, please feel free to click the check mark next to this answer to mark it as accepted. – Gortonington Mar 17 '17 at 15:46

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.