I've recently setup Web Analytic Connector (WAC). I'm now trying to customize the WAC string to return a static value in the utm_contact parameter when no link alias is assigned. By default this parameter returns the URL of the link.

Here is the initial code used, which does successfully deploy the email.


When I make the following edits, the email job cancels.

&utm_content=%%=iif(IndexOf(linkname,"http")>0, linkname,"unknownlink")=%%

I've used custom ampscript in the WAC strings before, but never in reference to the linkname personalization string. Is this possible? Any suggestions on how I might customize the utm_content output?


SFMC Support provided the following details on the email job that was cancelled after the WAC update.

MemberID: xxxxxxxxx JobID: yyyyy OMMSlotID zzzzzz 
ExactTarget.OMM.InvalidScriptException: An error occurred when attempting to resolve a function call. See inner exception for detail.
Function Call: iif(IndexOf(linkname,"http")>0, linkname,"unknownlink")
Index: 208
Content Type: Text
Substitution Level: Subscriber
Message Context: Unknown
- from OMMCommon --> 

--- inner exception 1---

ExactTarget.OMM.InvalidScriptException: An error occurred when attempting to resolve a script expression. See inner exception for detail.
Script Expression: IndexOf(linkname,"http")
MemberID: xxxxxxxxx
JobID: yyyyy
- from OMMCommon --> 

--- inner exception 2---

ExactTarget.OMM.InvalidFunctionException: The specified attribute or custom object field name was not found for this client.
Function Call: IndexOf(linkname,"http")
Attribute or Field Name: linkname
- from OMMCommon
  • Is the alias (linkname) assigned via an AMPScript va, SSJS var or personalization string? If so, I don't think this will work, judging from my interpretation of the docs. From Docs: Link alias values generated via personalization strings, AMPScript, or SSJS does not reflect in the %%linkname%% value. (help.salesforce.com/…) Commented Sep 26, 2018 at 13:22
  • The alias in my email is static text for one link and not supplied for the other. In the WAC string, I am not trying to set the value for %%linkname%%, just read and use it in an ampscript function. Commented Sep 26, 2018 at 14:53

1 Answer 1


Thanks @Gortonington for you comment. I took a closer look at the online documentation. There must be something special to this personalization string. The documentation states, "This personalization string is only available in use with the web analytics connector."

Unfortunately, I wasn't able to solve for my issue. But, I believe I've confirmed why it doesn't work.

I made the following update to my WAC string.

&utm_content=%%=iif(IndexOf(AttributeValue("linkname"),"http")>0, AttributeValue("linkname"),"unknownlink")=%%

I was able to successfully deploy emails after the update. But, all the links in my email had a utm_content value of "undefinedlink". To me, this means linkname must not yet be defined at the point this ampscript executes.

You must log in to answer this question.

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