cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Code: 4 Things to Know When Adding Links to Your Campaign

CTCT Employee
Custom Code: 4 Things to Know
When Adding Links to Your Campaign

Adding links to your newsletters can help obtain engagement from your campaigns and drive traffic to your website. They can be text links, which this article focuses on, or images can have links added to them as well. Another type of link is one that will open a new email in the default email client of the person who clicks it, which is called a mailto link. With this last type of link, you can add a subject line and body text to the email, too. Since mailto links are a little more complex than the typical link it is going to have its own article, so stay tuned!!

 

Editor's Note: At the bottom of the article there are some links that go to our KnowledgeBase, and my previous articles. Be sure to check those out!

 

1. The <a> tag and href attribute

The <a> tag has several different functions. It can be used to move within a web page as an anchor or paired with the href attribute to form the hyperlinks that we have become accustomed to when navigating the World Wide Web to our favorite web pages. 

 

2. Properly formatting HTML links for the Advanced Editor:

There are some restrictions to how a link can be formatted. For the link (href attribute) to work properly it is best to use a double quote format to prevent the links from breaking in email clients that may not 'read' the links correctly.

 

2.1 Good example based on the way the Constant Contact Advanced Editor works with links:

Correct format:
A. (double quote format): 
<a href="https://www.constantcontact.com">This is a valid link</a>

 

2.2 Examples of how the Advanced Editor does not work with links: 

Incorrect formats:
A. (single quote format): 
<a href='https://www.constantcontact.com'>This is not a valid link</a>
B. (spaces after first quote): <a href=" https://www.constantcontact.com">This is not a valid link</a>
C. (spaces before closing quote): <a href="https://www.constantcontact.com ">This is not a valid link</a>
D. (no quote format): <a href=https://www.constantcontact.com>This is not a valid link</a>

 

3. Why do some links work in the Preview and break after they are sent?

While many browsers and email clients will "fix," or adjust these links in the Preview, a live sent campaign will often break the links created using the wrong format. The tracking encryption added during the sending process turns the single quotes and spaces into multiple characters and encrypts them into the trackable link, which in turn breaks them. (See #4 on how best to test your campaign's links)

 

4. Best Practice:
It is always a good idea to review your links before you send to your full list. Scheduling a campaign to a small test group, so you can be certain everything is working as expected, is a great idea. This way you are sure the links are working as properly, and that you can get your campaign audience over to your website where they can continue to engage with your business or organization.


Helpful KnowledgeBase Articles:

Create a Custom HTML Email Campaign

Guidelines for Designing Custom Code Email Campaigns

 

Community Articles by Sue_Mc:
Overview How to Get Started with Custom Code

Custom Code Create an Email Framework Using Tables

Sue_Mc

Hello, my name is Sue and I have been with Constant Contact since June of 2009. For the last 7+ years my time has been spent in Tier 2 assisting customers and support via chat, email, and phones. Outside of work I enjoy learning code, reading, I am an avid crocheter, I love video games, and spending quality time with my 21 year old cat. I am new to writing for the Community, and have high hopes that we will have great discussions about technical issues.

3 Comments
Alice
Not applicable
I keep getting "problem loading page" when I click onto some links connected with r20.rs6.net. How do I solve this?
bob daknis
Not applicable

I use the double quotes like suggested but some people say their email links don't work?  It just brings up the picture  - 

this is the code ....  i use a software package to map out links in a JPG... called Image Mapper by CoffeeCup

-------------------------------------------------

<html>
<head>
<title>Test Preview Page</title>
<meta name="generator" content="CoffeeCup Image Mapper">
</head>
<body>

<!-- Created by CoffeeCup Image Mapper (www.coffeecup.com) -->

<!-- Beginning of Client Side Image Map -->
<img src="http://elkins-lane.com/wphome/test_stuff/321-walker-finish-a3-800.jpg" USEMAP="#NotNamed" BORDER=0>
<map name="NotNamed">
<area name="item01" shape="rect" coords="106,967,217,1015" href="https://www.youtube.com/watch?v=UJdN3z3b2cI" alt="Aerial Video" title="Aerial Video">
<area name="Item02" shape="rect" coords="227,969,325,1014" href="http://seetheproperty.com/presentation_v2/presentation.php?order_id=277197&mode=branded&t_mode=sfsto..." alt="Virtual Tour" title="Virtual Tour">
</map>
<!-- End of Client Side Image Map -->
</body>
</html>

CTCT Employee

Hello Bob! 

Thanks for joining us in the Community! We'd be more than happy to look into this for you. Please email us at social_support(at)constantcontact(dot)com with your current username, which campaign you are working, text version of the code you are trying to use and a reference to this post.