How to not track an individual link in a Salesforce email

To track clicks in a SalesForce email template, you add the proprietary “custom” tag in the body of your HTML.

<custom name=”opencounter” type=”tracking”>

This will track all links.

But, what if you do not want to track individual links?

You can create a variable and assign the complete “a” tag to it, including the clickable text, and the closing “</a>”.

SET @Targetbase = ‘<a href=””>Do not track this link to Targetbase</a>’

In the body of the email, you just render the print the value of the variable.


Thank you for reading!

Dynamic Sender Profile

Dynamic Sender Profile

You can use personalization in your Sender Profile. You can’t use AMPscript that is set in your email template because the Sender Profile is read before the email template. You can use a content area, as that is read before the Sender Profile.

Create a dynamic sender profile and use the AMPscript function “ContentAreaByName” to pull in the content.

 %%=ContentAreaByName("my contents\From_Name_TTT")=%%

In the content area, you can use the variable print function to display your AMPscript rendered content.

SET @CLINIC_NAME = LOOKUP("The Name of the data ext","CLINIC_NAME","subscriber key",_subscriberkey)
SET @From_Email = Concat(@CLINIC_NAME,@DOMAIN) 


Thank you for reading!

ExactTarget AMPscript – data extension stuff

Let’s say we want to read a data extension and get some data from it.

First we use the “LookupRows” function to get some data from the DE. We are going to assign the results to a variable (multiRows).

The first parameter of the LookupRows function is the name of the DE you want to connect to. In this example, “myDataExt”.

The next to parameters are comparing a value to a value in a particular field in the DE. It is looping through the records looking in the ID field for a value equal to “1234”. The value it’s looking for could of course be a variable. In this example, it’s just a string, “1234”.

SET @multiRows = LookupRows("myDataExt","ID","1234")

Now the variable @multiRows holds the records where the ID and “1234” match, if there were any.

You can now loop through those records and get the data in those records.

for @i = 1 to RowCount(@multiRows) do
  Set @row = Row(@multiRows,@i)
  Set @Fname = Field(@row,"Fname")
  Set @Phone = Field(@row,"Phone")
next @i

Thank you for reading!

AMPscript – Count records in data extension, show percentages

I had a project where the client wanted the email recipient to take a simple survey by clicking on a certain link that answers the survey questions. It’s a way to fake a form in a sense.

What is your favorite holiday? (click the appropriate button below)

  • Christmas
  • Thanksgiving
  • Easter

Each button is a link to an ExactTarget hosted landing page. The link passes the users Subscriber Key, email address, and the holiday they chose.

The link would look something like this:


The landing page stores this info into a data extension.

SET @sk = QueryParameter(“sk”)
SET @emailaddr = QueryParameter(“emailaddr”)
SET @occasion = QueryParameter(“occasion”)

SET @SurveyTestDataExt = “Survey DE”
SET @message = “Thanks for your response”

SET @multiRows = LookupRows(@SurveyTestDataExt,”Subscriber Key”,@sk)
SET @CountRows = RowCount(@multiRows)

IF @CountRows > 0 THEN /*checks to make sure the Subscriber Key does not already exist in the data extension. */
SET @message = “You have already submitted a response. Thank You.”
InsertData(@SurveyTestDataExt,”Subscriber Key”,@sk,”Email Address”,@emailaddr,”Occasion”,@occasion,”CreatedDate”,NOW())

The above code matches the users subscriber key with one (if there is one) in the data ext. If one exists, the page shows a message saying they have already taken the survey. If not, the SubKey, email, and holiday they chose are stored in the data ext.

Next, we look up and count how many rows exist in the DE that are for “Christmas”.

SET @ChristmasRows = LookupRows(@SurveyTestDataExt,”Occasion”,”Christmas”) /* Get Christmas records */
SET @CountChristmasRows = RowCount(@ChristmasRows) /* Get a count (number) of Christmas records */

SET @TotalRows = LookupRows(@SurveyTestDataExt,”isRow”,’True’) /* Get all records by getting all records where the field “isRow” is equal to “True”. By default, every record will have this field true. If for some reason we don’t want to count a record, we can have that record have isRow equal to False. */
SET @CountTotalRows = RowCount(@TotalRows) /* Get a count (number) of all records */

SET @Christmas_perCent = Divide(@CountChristmasRows,@CountTotalRows)
SET @Christmas_perCent = Multiply(@Christmas_perCent,100) /* Get the percentage of records that are Christmas. */
SET @Christmas_perCent = FormatNumber(@Christmas_perCent,”F0″) /* Round the percentage */

Show the results:

<h3>Poll Results:</h3>
%%=v(@Christmas_perCent)=%%% picked Christmas


Thank you for reading!