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

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="">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=''>This is not a valid link</a>
B. (spaces after first quote): <a href="">This is not a valid link</a>
C. (spaces before closing quote): <a href=" ">This is not a valid link</a>
D. (no quote format): <a href=>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



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

Custom Code Create an Email Framework Using Tables

Not applicable
I keep getting "problem loading page" when I click onto some links connected with 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


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

<!-- Created by CoffeeCup Image Mapper ( -->

<!-- Beginning of Client Side Image Map -->
<img src="" USEMAP="#NotNamed" BORDER=0>
<map name="NotNamed">
<area name="item01" shape="rect" coords="106,967,217,1015" href="" alt="Aerial Video" title="Aerial Video">
<area name="Item02" shape="rect" coords="227,969,325,1014" href="" alt="Virtual Tour" title="Virtual Tour">
<!-- End of Client Side Image Map -->


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. 


I am also having the same links connected with instead of my original links.  Any updates on this?

Community Knowledge Base

Learning & Resources

We take questions asked by customers on the Community and expand on them to help you find answers fast, getting you back to using Constant Contact's suite of amazing tools in no time.

Read More

  • Support Tips

    Reporting Metrics

    "Our reporting metrics can provide a list of bounced contacts that we recommend for removal. Use this to you advantage to improve your delivery and engagement, clean your lists, and keep your subscription costs down!" - Will

    See Article
  • Support Tips

    Call-To-Action Links

    "Including too many links in an email may shift attention from your main call-to-action. Limit links to keep the goal clear." - Kyle

    See Article
  • Support Tips

    Read Before You Send a Test Email

    "Did you know? You can send unlimited test emails to your verified email address, but only 50 in a 24-hour period to non-verified email addresses." - Nick

    See Article