0

I am launching a personalized fax marketing campaign. Under the hood, I'm using SFMC to send a personalized email to an email-to-fax service.

Each email includes a custom QR code - using the approach outlined in this article where the URL itself contains person-specific UTM parameters.

Ideally, I would like to track who visited our website using SFMC's URL wrapping. My question is if someone knows how to construct the wrapped URL before calling the API to generate a QR code.

Proposed pseudo-code below:

%%[

SET @BASE_URL = "https://example.com/?"
SET @SLUG = AttributeValue("url_slug")
SET @FULL_URL = CONCAT(v(@BASE_URL), v(@SLUG))

/* Question: Is this possible and if so how? */
SET @TRACK_URL = RedirectTo(@FULL_URL)

SET @QRCODE = CONCAT('https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=', @TRACK_URL)

]%%

<img src="%%=v(@qrcode)=%%">

1 Answer 1

1

You won't be able to use Marketing Cloud's built in click tracking. You need to create the QR code prior to the email being generated. At that point, we don't have the details needed to generate the tracking link, as it is requring a.o. jobid, batchid, etc - which are known only at sendtime.

My suggestion to you would be to use a Cloud Page code resource to take care of the tracking. In order to build such a solution, you will need to observe following steps:

  • a code resource should be built, which will receive following parameters in the url:
    • a URL encoded version of the actual destination for your qr code, as a parameter
    • subscriberkey
    • some campaign identifier
  • your qr codes should be unique and hold information specific to that particular subscriber and campaign, along with the urlencoded version of the destination url. E.g. if you want to point to https://salesforce.stackexchange.com/, your URL for QR code will looks something like: https://cloud.sap.example.com/redirectResource?target=https%3A%2F%2Fsalesforce.stackexchange.com%2F&campaign=fax&subscriberkey=47a4b0d5-9b1f-4ace-9a9c-028596526127
  • when someone gets to that url, following things should happen:
    • the target parameter is decoded, using SSJS, as Amspcript can only do URLencode
    • a new record is added to a data extension, holding information about the destination, campaign, subscriber and a timestamp of when the record is added
    • the person is redirected to the url provided in the target parameter
1
  • 1
    as a note, I have used a DE to hold the target URL before and just passed a keyphrase or ID in it that then does a lookup to the reference DE to get the URL. This removes the issue with URLEncode/Decode and also can allow you to shift/edit/change the target URL without touching the email or worrying about having to change the link in existing sends. Commented May 15, 2023 at 14:26

You must log in to answer this question.

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