0

My Tracking String in WAC is the following:

utm_source=Email​&utm_medium=%%=v(@utm_medium)=%%​&utm_campaign=%%emailname_%%​&utm_term=%%linkname%%​&utm_id=%%jobid%%​&sfmc_id=%%subscriberKey%%​&reaId=%%ReaID%%

ReaID is a field on all sendable data extensions, hence it is populated as expected within the personalization string %%ReaID%%.

However, I need to create a new triggered email where ReaID cannot be included in the sendable data extension, so I need to use an AMPscript lookup to fetch it from a different data extension.

My new email has this AMPscript code:

set @ReaID = Lookup('MasterData', 'ReaID', 'SubscriberKey', _subscriberkey)

When I try to output the ReaID value in the email, it is displayed correctly, so it's all good for now.

I also need to edit the WAC tracking string to retrieve the AMPscript value for ReaID when the personalization string %%ReaID%% is empty. This way it will work for all my emails.

Here's my final function: %%=iif(not empty([ReaID]),[ReaID],@ReaID)=%%

And here's the final WAC tracking string:

utm_source=Email​&utm_medium=%%=v(@utm_medium)=%%​&utm_campaign=%%emailname_%%​&utm_term=%%linkname%%​&utm_id=%%jobid%%​&sfmc_id=%%subscriberKey%%​&reaId=%%=iif(not empty([ReaID]),[ReaID],@ReaID)=%%

This solution works when ReaID is an attribute of the sendable data extension, however, it doesn't when ReaID needs to be fetched from my "MasterData" data extension with AMPscript. The email is not sent at all, which makes me think that there should be some kind of syntax error, but I don't know what it is.

Any ideas?

0

You must log in to answer this question.

Browse other questions tagged .