Posted on Leave a comment

UTM Codes: How to Create UTM Tracking URLs on Google Analytics

How do you know if Facebook is a worthy investment, or if you’re getting enough traffic from your recent promotional campaign? The answer: UTM tracking links.

UTM codes help you track where traffic is coming from, allowing you to properly measure each campaign’s, platform’s, or medium’s ROI.

In this blog post, you’ll learn what UTM codes are, how to use them, and how to build them in both Google Analytics and HubSpot.

UTM codes are also known as UTM parameters — or tracking tags — because they help you “track” website traffic from its origin.

Now, you might be thinking, “Ginny, I have HubSpot, so I already know if my website traffic is coming from Google, email, social media, and similar marketing channels. What does a UTM code tell me that I don’t already know?”

HubSpot Marketing Hub provides you with these high-level sources of traffic, but UTM also helps you drill down into specific pages and posts within these traffic sources. If you’re promoting a campaign on social media, for example, you’ll know how much traffic came from social media. Building a UTM code, however, can tell you how much of that traffic came from Facebook or even a particular post on Facebook.

UTM Code Example

UTM codes can be overwhelming at first, so let’s take a look at an example. Here’s a URL with its own UTM code: &utm_medium=social&utm_source=facebook

Let’s break this link down. This is the base URL of the page.
?: This signals to your analytics software that a string of UTM parameters will follow.
utm_campaign=blog_post: This is the first UTM parameter, specifically for the campaign the visitor engaged with (in this case, a blog post campaign).
&: This denotes that another UTM parameter will follow.
utm_medium=social: This is the second parameter, specifically for the channel the visitor came from (in this case, social).
&: This denotes that another UTM parameter will follow.
utm_source=facebook: This is the last parameter, specifically for the specific website the visitor came from (in this case, Facebook).

In the example above, you’re saying that once traffic comes in from people who click this link, the traffic should be attributed to Facebook. The “medium” is social media, while the “source” is Facebook.

Adding these snippets of code after the question mark above doesn’t affect anything on the page — it just lets your analytics program know that someone arrived through a certain source inside an overall marketing channel, as part of a specific campaign.

How do UTM links help marketers?

Crucial aspects of being a great marketer are being able to measure your success and measure your impact. No matter which metrics you use, you want to prove to your boss (and the company) that you’re worth your salt.

You deserve your budget — and maybe need more of it — and you deserve to dedicate time to the marketing activities that work. Building UTM codes that track your campaigns’ success is the best way to prove it.

Relying on your analytics tool’s source and medium breakdown isn’t enough to prove whether a certain strategy is working. UTM links provide more granular data that allow you to drill down to the specific source of the traffic. You can use the following UTM parameters, which we’ll cover in more detail later:


With that in mind, UTM tracking codes can help you determine:

1. Where the traffic is coming from (Source).

First up, you’ll be able to tell the specific website the traffic is coming from. Examples include:

Social websites (Instagram, Facebook, Pinterest, YouTube, LinkedIn, etc)
Search engines (Google, Bing, Yahoo, etc)
Paid posts and sponsored listings (paid ads, sponsored posts, etc)
Other websites (your own site, competitor’s sites, publisher’s sites)

2. Which general channel the traffic came from (Medium).

It’s also important to know the general categorization of the source. That way, you can determine whether social media in general is a worthwhile investment, as an example. Organic search, social, CPC, and email are a few mediums you can use.

3. What type of content people clicked on (Content).

What gets the most clicks? An image, a sidebar link, or a menu link? You can tell this information with the content UTM parameter. This is essential for determining whether you need to add more images, for instance, or improve your sidebar link structure if no clicks are coming through that content.

4. Which term they used to access the page (Term).

UTM links can also help you see which terms are driving traffic to a specific page. By using the term parameter, you can determine which keywords are driving the most traffic to you, and which need more love.

Putting it all together, here’s what a UTM-tracked URL can look like:

Now, let’s take a closer look at the UTM parameters you can use.

UTM Parameter Examples

UTM codes can track a medium and a source within that medium. Where it gets more flexible is in the language you use to describe that source. Maybe you want to attribute website traffic to a social network, a type of content, or even the exact name of an advertisement on the web.

Here are the five things you can track with UTM codes and why you might track them:

1. Campaign

Campaign-based tracking tags group all of the content from one campaign in your analytics. The example UTM code below would help you attribute website traffic to links that were placed as a part of a 20% discount promotion you’re hosting.

Example: utm_campaign=20_off

2. Source

A source-based URL parameter can tell you which website is sending you traffic. You could add the example code below to every link you post to your Facebook page, helping you to track all traffic that comes from Facebook.

Example: utm_source=facebook

3. Medium

This type of tracking tag informs you of the medium that your tracked link is featured in. You can use the example UTM code below to track all traffic that comes from social media (as opposed to other mediums, like email).

Example: utm_medium=social_media

4. Piece of Content

This type of UTM code is used to track the specific types of content that point to the same destination from a common source and medium.

It’s often used in pay-per-click (PPC) campaigns or with two identical links on the same page, as shown in the sample UTM code below.

Example: utm_content=sidebar_link or utm_content=header_link

5. Term

A term- or keyword-based tracking code identifies the keywords you’ve paid for in a PPC ad. If you pay for a Google Ads campaign to rank under the keyword, “marketing software,” you might add the following UTM code to the end of the link you submit to Google to run this ad.

Example: utm_term=marketing+software

The best part about UTM parameters is that you can make any combination you like of these codes — use the bare minimum (campaign, source, and medium) to track all of your links, or use all of them to get super specific about your tracking.

UTM Tracking

UTM tracking entails adding a UTM code, a snippet of code, to the end of a URL in order to track the performance of your marketing campaigns and content as well as your website’s traffic sources.

UTM Tracking Best Practices

Here are some best practices to keep in mind when creating and using UTM tracking URLs:

Make your URLs and links are consistent, clean, and easy to read (you may create a standard for link tagging/UTM parameter guide to ensure consistency here).
Keep a list of your UTM links so everyone on your team knows which tagged links currently exist.
Connect UTM tracking to your CRM (like HubSpot) to gain insight into how your bottom line looks.
Be specific with your URL UTM parameters so your tags clearly state what you’re tracking and where.
Stick with all lower or upper case — UTM codes are case-sensitive.
Keep names short but descriptive (e.g. “US” versus “United_States”).

Okay, so you’re on board with UTM codes … but how the heck do you set them up? It’s easy.

Below are instructions for setting up and measuring UTM parameters in Google Analytics and HubSpot.

How to Build UTM Codes in Google Analytics

Here are the steps involved in building UTM codes in Google Analytics.

1. Open Google’s Campaign URL Builder.

There are three different types of tracking tags you can create in Google, two of which help you track traffic to new apps on app marketplaces. You’ll be using the Google Analytics Campaign URL Builder — the third option on this list.

2. Fill in each link attribute in the following form.

Visit the page linked above and click the link to see this URL builder. Then, you’ll see the UTM builder shown below. Add the URL, Campaign, Source, and Medium information into their respective boxes.

3. Use the link in your marketing campaign.

If you’d like to shorten it, you’ll need a tool like … or just use HubSpot’s URL Builder if you’re a HubSpot customer.

4. Measure your success.

If you already have Google Analytics set up for your site, Google will automatically track incoming campaigns. Like in HubSpot, you can access them under “Audience,” then “Sources,” then “Campaigns.” Click on each campaign to view the source and medium.

And that’s it — you’ll have custom tracking codes set up and running in no time! In a few weeks, you’ll be able to make a case for what you need because you’ll have the right metrics available.

How to Build UTM Codes in HubSpot

Here’s how you’d go about building UTM codes in HubSpot.

1. Navigate to your Analytics Tools.

In your Marketing Hub dashboard, select “Reports” on the top navigation bar. Then select “Analytics Tools” in the dropdown, as shown below.

2. Open the Tracking URL Builder.

In the menu of analytics tools that appears, look to the very bottom-righthand corner. You’ll see the option, “Tracking URL Builder.” Click this option at the bottom of the page, as shown in the red box below.

3. Open the Tracking URL form to create a new UTM code.

Whenever you create a web campaign that includes at least one UTM code, you’ll see this campaign listed on the page shown below.

This page outlines a tracking tag’s source, medium, term, content, and creation date, which you can see along the bottom of the screenshot below. Click “Create Tracking URL” in the top-righthand corner.

4. Fill in each attribute of your UTM code and click “Create.”

In the form that appears, fill in the URL, Campaign, Source, and Medium fields. If you’d like to add Content and Term, you can do so in the bottom two fields of this form. When you’re done, you’ll see an orange “Create” button become available at the bottom.

Click it, and HubSpot will log your UTM code as a new campaign, and this link will be ready to include on any webpage from which you want to track the traffic.

5. Use the shortened link in your marketing campaign.

6. Measure your success.

You can track your UTM parameters in your Traffic Analytics dashboard under “Other Campaigns,” as shown below. Click on the individual campaign to break down the source and medium.

As you can see in the second image, below, the name of the campaign appears to the left — based on the text in the UTM code you created — with the traffic from people who used each URL to arrive at your campaign’s main webpage.

Now that you know how to set up UTM links, how do you use them? Let’s take a look.

How to Use UTM Links for Your Campaigns

You can use a combination of UTM codes and parameters in a lot of ways. Here’s how you can use them in your day-to-day as a marketer.

1. Track the success of a promotional campaign.

Dropping product prices or launching a new product can be daunting, because if there’s no measurable ROI, it’ll be wasted effort. Luckily, you can tell whether users are effectively arriving to your site from your promotional efforts using UTM codes.

Here’s one example for a product launch:

Or, if you’re running a discount campaign through Instagram influencers, here’s what a UTM link can look like:

2. See how well your social channels promote your content versus when your followers promote your content.

How do your organic social efforts stack up against your followers’ promotional efforts? You can create two UTM campaigns to find out.

For your own posts, you can share a link as follows:

Then, prompt your followers to share the word about you, but let them share the following link:

3. Measure the effectiveness of guest posting referral traffic.

If you’re guest posting on several industry websites, it’s essential to know whether those posts are driving traffic to your site. Guest posting can be a time-consuming, costly endeavor, especially if you’re paying a freelance writer or for a spot on the publication.

Whenever you create a guest post for another publisher, ensure all the links pointing to your website on that post have UTM parameters that tell you where the traffic came from. Here’s one example:

4. Track the same piece of content across multiple marketing channels.

This is probably one of the most useful ways to use UTM tracking codes: Creating different ones for the same piece of content, and using it across different platforms. You can drop the campaign parameter for this use case, and simply track the medium, source, and content.

Let’s say you want to track referral traffic from a video you posted on LinkedIn, YouTube, and Facebook. Here are the three different links you could use:


5. See where most people click on your internal links in a blog post.

Is your internal linking strategy working as intended? You can track where your content gets the most clicks by adding UTM parameters. Here are three examples:

Above the Fold:
Bottom of the

Note: Use this strategy with caution, as using too many UTM parameters in internal links can cause confusion to Google. You should use it on a small batch of internal links, collect the clicking patterns, delete the UTM links, and then act on those results for your future internal linking efforts.

As always, ensure that you’ve set a canonical URL for each link to minimize confusion and prevent duplicate indexing.

Start Creating UTM Tracking URLs

Use the steps, best practices, and tools above to start creating and using UTM tracking URLs so you’re able to track the performance of your marketing campaigns and content. That way, you can reliably boost your metrics and improve the ROI of your digital marketing strategy.

Editor’s note: This post was originally published in September 2013 and has been updated for comprehensiveness.

Posted on Leave a comment

How to Write a Video Script [Template + Video]

Videos tell a story. Whether you’re writing an original video script or using a video script template, your script is essential to that story.

And videos are powerful selling tools. 92% of marketers say that video is central to their marketing strategy.

But creating videos can be intimidating. It’s complicated whether you’re a writer, marketer, or movie producer. There are many steps to planning, editing, and producing videos and each step is important.

Writing an effective video script can mean the difference between video success and failure. This post will show you how to write an effective script for your videos. Are you ready to get started?

Even the most basic video will be better with a video script. Creating a video is complex. Most video projects include:

Cast and crew

Each of these elements can be tricky to execute, and when they combine, it’s easy for mistakes to happen.

But your script will include details that make the process run smoothly. A video script is vital to help your team prepare for and organize the video-making process.

Plus you and your team will be more confident and produce a better video with a comprehensive script.

1. Choose your target audience.

Any marketing project is better with the right buyer persona. This is especially true with video.

Because videos often take more time and investment than an online ad or blog, it’s important that your video speaks to a specific audience.

So, before you start developing characters or a brief for your video, you need to figure out who your video is for. Your target audience for your video script can impact:

The length and format of your video
Where you post your video
Setting, costume, and lighting

If your video is for brand awareness, you may be broadcasting to a large and diverse audience. But what if you’re introducing a product or feature? In that case, you’ll want to focus your audience on the buyers that are most likely to feel the pain point your product solves.

If your video is for employee or customer retention, you might want a different approach. You’ll want to review data, reviews, and testimonials before you begin your script brief. This will help you create the story and dialogue that your audience will respond to.

2. Set a goal for your video script.

Videos are usually team projects. Without a single focus, every person could come to the video with their own idea of what it’s about. As the project continues, this can turn a simple video into a convoluted mess.

That’s why it’s important to start your video script by just thinking about your goal. So, before you jump into a storyline, character, or setting, figure out the why.

Why are you making this video?

Do you want to teach people about your product? Are you introducing a new pricing structure? Are you trying to expand into a new niche?

If you’re not sure about your goal, think about the problem you’re hoping this video will solve.

For example, say you’re struggling with conversions for a new product.

Is it because you’re breaking into a new niche? A product video on the right social media platform for this niche might be right.
Do users need better instructions? You might want to add a product tour or instructional video to your website.
Are you getting good reviews? You may want to partner with influencers to build a reputation for this product.

Don’t jump into your video script without deciding on a single goal.

Then, use your goal to set the metrics you’ll use to measure the video’s performance once it goes live.

3. Choose the main character for your video.

Video marketing helps you show your viewers what your product can do instead of telling them. And characters are essential to storytelling.

Choosing the main character for your video before you begin your script will help you focus on telling a story, not just selling an idea. This will help your audience connect and engage with your video.

You may already know that your main character is your ideal customer or your CEO. They could be a celebrity, a cartoon of your product, or a narrator who speaks in your brand voice.

But if not, before you start writing your video script, decide who will be the focus of your video.

If you don’t know who your main character is, go back to your goal and target audience. Think about who your buyer persona wants to hear from as they reach that stage of their journey.

Next, outline your main character. You can use the habits, quirks, and voice of your main character to paint a picture for your audience that helps them remember and relate to your video.

Once you’ve figured out your main character you can decide how they relate to your product. Do you want to talk about their back story? Are you going to talk about a specific experience they had and how your product helped?

4. Create a brief.

Creating a brief allows you and your team to document the answers to the most important project questions. This helps everyone involved understand the who, what, when, where, and why of your video.

Say you’re three-quarters of the way through the editing process. If your boss or colleague wants to completely redo half of your video, that’s a huge problem.

Challenges like this can impact your budget, timing, and campaigns. But with a brief, you can refer to the goals and project plan your team mapped out together, and say, “Actually, that’s not what we agreed to.”

Then, you can move forward.

Focus on your goals, topic, and takeaways in your brief.

A brief doesn’t have to be fancy, nor does it have to follow a specific formula. But there are several key questions it should include to craft an effective video script.

What’s the video topic? (The more specific, the better. For example, if you’re in the house painting business, you might choose a topic like, “buying the right paint brush”).
What are the key takeaways of the video? What should viewers learn from watching it?
What’s our call-to-action? What do we want viewers to do after they’ve finished watching the video?

You can easily create a brief in Google Docs to serve as a living, breathing template that you revise over time – and that your team can collaborate on.

5. Use your brief to write an outline.

Once you’ve picked a topic and written a brief, it’s time to start constructing your video script. We recommend starting with an outline to give structure to your video script. This way, you can break your video into subtopics and decide how your dialogue (or monologue) will progress.

Are you basing your video script on a blog?

You can’t just rewrite a blog post and call it a day – there’s a specific way to write a blog-based script so that it shapes an effective video. Alicia Collins can teach you a bit more in the video below (and yes, we wrote a script for it).

Like Alicia says in the video above, a video script shouldn’t simply regurgitate the blog post word-for-word. Blog posts are ideally written to be conversational. But there are pauses and verbal explanations you’ll need to add to your speech patterns that you wouldn’t have without your script.

But, using the blog post’s subsections is a helpful starting point when figuring out how your script will progress from one section to the next.

Are you writing an original video script?

Start with a well-structured outline. Many video scripts follow a three-part structure that includes:

An introduction and hook to draw viewers into your video
A problem, pain point, or question comes up
A conclusion and resolution of the problem, including a call-to-action

This is a basic video script structure, but there are many ways you can go as you outline your story. This structure will help you write a script that covers the details that make your video believable and useful to your audience.

As you create your outline, think about where natural transitions happen.

For example, say you’re writing a video script about the life of a new product. You might outline your script with the steps a business might take to launch a product, including:

Coming up with the idea
Doing market research
Designing the new product
Producing a test product
Editing the product for mass production
Audience testing
Marketing and sales strategies
Product launch

Your primary goal is to engage your target audience with a situation they can connect with. This can help them understand how the challenges you share in your video relate to the problems they want to solve in their own lives.

6. Start writing your script, section by section.

Your video script doesn’t have to be fancy. You’re not trying to submit this script for any awards – its purpose is strictly functional. A good script makes it easy for the people on camera to get their messages across while sounding and acting naturally.

Write conversationally.

Writing a script isn’t the same as writing a college paper or marketing research report. You want to write the script how you want the video subject to speak.

Saying, “I’m gonna create a video after reading this blog post” on camera will read much better than, “I am going to create a video after reading this blog post.” Keep sentences short and crisp and try to avoid compound sentences.

Make it thorough.

A script doesn’t just include dialogue. If your video will require multiple shots, characters, or scenes, include these details. Be sure to include any necessary information about the set or stage actions, such as a wardrobe change.

Basically, you want the script to be thorough enough that you could hand it off to someone else to shoot, and they’d understand it.

Write for the audience and the platform.

Make sure you’re keeping your script conversational for the people you’re trying to connect with – and infuse humor, tone, and inflection accordingly.

For example, if you’re writing a short-form video for Facebook, you might want to consider keeping your script choppier with sentence fragments. But if you’re producing a long-form explainer video for your website, make sure you’re as thorough as possible.

Script every single word.

It’s understandable to think you can just jot down the main bullet points for a script, and then just wing it on camera, especially if you know your subject matter.

This approach makes it tough to communicate a message as clearly and concisely as possible and it usually results in a lot of redos.

So, we suggest scripting every last word. Doing this will keep you organized during filming and save you loads of time later.

7. Edit your video script.

Writing is tough, and it’s easy to get stuck if you expect your video script to be perfect on your first draft. It’s worth doing two to three rounds of edits to cut any unnecessary words in your writing.

These are a few more tips for editing your script so that the video script can make your final video shine.

Give yourself a break.

Step away from your script after you write it, and don’t go back until you can look at it from a fresh perspective.

Check for transitions.

Dialogue and actions will move your story forward. So, look for moments in your script that feel abrupt or awkward. Then, add details that will help your viewers understand what is happening.

Cut the extras.

Great writing and interesting dialogue will be bad for your video if they don’t advance your story. Edit out these parts and save them for a later project if you think they can be useful.

8. Do a verbal run-through off-camera.

Now that you know how to write a script, it’s time for a table read. This is the part where you practice bringing your script to life on camera.

Why practice? Because some words look great on paper, but once you read them aloud, they just don’t sound right. Reading your video script out loud can help you make the language more conversational and your sentences shorter.

You can read your script aloud while editing, but the table read is where you really get to fine-tune the tone. It’s when you can nix anything that sounds too proper, improper, robotic, or otherwise inappropriate for the message you want to convey.

Check out this video for a fun example of a table read:

Video Script Template

Writing a script from scratch is way harder than starting with an example.

This video marketing starter pack includes a free video script template. Take a look at this HubSpot video below.

Next, check out how we’ve used HubSpot’s video script template below to include the elements described throughout this blog post.

Download the template and get started today.

Video Script Example

There are many different ways to write a video script. Usually, the format you use will depend on the length and complexity of your video. Adding columns can help you organize crucial information like:

Dialogue by scene
Run time
Effect and audio cues

Besides the video script template above, the examples below are other ways you can approach your video script.

Single column script:

Two-column video script

Four-column script:

Image Source

1. Create a powerful beginning.

You have more viewers during the first 10% of your video than at any other time. So, your top goal when writing a video script is to hook viewers at the beginning so that they keep watching until the end.

Use the first few lines to introduce the main character or narrator and what the audience is going to learn by the end of the video. You can offer in-depth details later in your video.

For example, if you’re teaching viewers how to optimize their blog for SEO, your introduction might be:

“Hi there! I’m [narrator’s name] from [company], and in the next [length of video] minutes, I’m gonna teach you how to get your blog ranking on Google.”

And don’t forget that some viewers will be watching your video without sound. Viewers who are silently scanning your social media or website will still need to quickly understand what your video is about.

2. Be concise.

When it comes to marketing, shorter videos tend to be more compelling than longer videos. In fact, 68% of people said they’d rather learn about new products and services through a “short video,” according to a survey by Wyzowl.

To make short videos, you need a short script. Don’t write a script any longer than two pages. If you can keep it to one page, even better.

The result is a video that’s succinct, engaging, and allows for a simple editing process.

3. Write in short paragraphs.

Time is important when you’re writing a script. If you’re reading at an average pace, you’ll cover about two words per second.

Short paragraphs make it easier to understand the timing of your script as you write and edit it. They also make it easier to use a teleprompter.

So, try to keep your paragraphs to 3-4 sentences at most.

4. Support any B-roll with the proper callouts in your main narrative.

If your video will transition from a person speaking in front of a camera to a close-up shot of your product or a demonstration, write these cues into your script.

This way, anyone who reads it knows to introduce these things to the viewer.

What is B-roll?

These secondary shots are often referred to as B-roll, which take place while the person continues to speak off-screen. B-roll is one of the main differences between a blog post and a video script.

For example, if a blog post reads, “take a look at the graph below,” it’s clearly referring to a graph embedded below that sentence. This phrasing won’t work on camera.

Instead, your video script might read, “in the graph you see here” – while you show the graph on-screen.

Give cues to your characters or narrator.

These written exceptions help cue your talent to take certain unspoken actions while reciting the script. It’s also a good idea to add open loops so that your audience has an idea of what is coming next. This will make them more willing to wait through a section that they mind not find engaging.

5. Use graphics to make your video stand out.

Visual cues are important to add to your script. Graphics help you make your dialogue easier for viewers to understand and remember.

Options for graphics you can add to your videos include:

Moving text

It can be tempting to add visuals just for the cool factor. But every image you add should offer value to your viewers. And if you think about these visuals as you write your script they will feel more natural in your final video.

6. Add some variety to your script.

Writing video scripts is fun, so make sure that the fun shows. As you write and edit your script, try new things to spice up your dialogue, visuals, and structure.

These are a few ideas that can help you add something new to your script writing.

Create backstories for your characters.

For example, say your main character is talking about finding a better toothbrush. If her back story is that she was a cookie-loving pastry chef who’s prone to cavities, sharing her back story lets your audience know what inspired her when she was first starting out.

Use opposites.

Opposites are a popular concept in improv acting, and they can help when you’re adding variety to your script.

For example, say your script features two ambitious characters. One could be ambitious because they got poor grades in high school and they want to prove themself. The other is ambitious because they have always performed well in school and they want that to continue. These different motivations will help make their conversations more interesting.

Get inspired.

Films, videos, books, and pictures can all help you create a more vivid world for your video script. You can apply your inspiration directly to the scenes you write or use it for motivation when you’re feeling stuck.

Think visually.

Another way to add variety is to step back and look at the big picture. Writing an outline of your script on notecards, or using a card for each scene can help you get a sense of where your script may need some work.

7. Plan to repurpose your video content.

While a great final video is your ultimate goal, you’ll also want to plan for the future as you write your script.

Most marketing videos won’t just post to a single platform – your team will share clips on social media, in email, and during presentations.

So, it’s smart to plan for repurposing. As you write, think about moments in your script that could be engaging on their own.

Even if you’re writing a script for a short video, try to write with quick clips in mind. For example, if you’re creating a two-minute video, plan to pull out a few five-second clips.

Use your video script to create incredible videos.

A video script can be a quick outline or a carefully written work of genius. Either way, it will form the foundation of your video and have a major impact on your results.

When you’re scripting you can let your creativity run wild, test new ideas, and push boundaries. Use these steps, tips, and templates to invent and experiment. Get to work and help your business soar.

Editor’s note: This post was originally published in May 2019 and has been updated for comprehensiveness.

Posted on Leave a comment

How to Create an HTML Form That Sends You an Email

Have you ever set up a form on your site, only to forget to check the entries that were submitted? Creating an HTML form that sends an email after submission is one of the simplest and most effective ways of resolving this issue.

Here, we’re going to walk you through how to create a form that sends an email to you, as well as the customer, to ensure the form was received.

Ideally, browsers would allow you to route form submissions directly to an email address. However, the reason they don’t is that emailing directly from an HTML web form would reveal the visitor’s email address, making the user vulnerable to malicious activities, such as phishing.

Adding a mailto: address to the form can be a potential way to circumvent this challenge. This option activates the default mail client on the user’s computer, prompting them to send the form over email. The web browser sends a request to the email service provider, not to the specified address.

There are a few problems with the mailto: option. For example, it isn’t 100% compatible with all browsers, it isn’t very user-friendly, and it’s impossible to control the formatting of the data when the form is sent by the browser.

Beyond that, a warning message will pop up when the user goes to submit the form, letting them know that the information they’re about to send will not be encrypted for privacy.

Below, we go over a few options for creating an HTML form that emails you when a new entry is submitted.

The option you choose depends on how you work and what platform you’re using. This is to say that things are a little different if the plan is to use a mix of HTML and different scripts. Below, we go over the different options available.

Method 1: Create an Email Send Form Using HTML (Not Recommended)

Using just HTML? From starting fresh, here is a sample code for use:

See the Pen How to Create an HTML Form That Sends You an Email by HubSpot (@hubspot) on CodePen.

This code will create a form that asks for the contact’s name, message, and includes a submit button (not visible in CodePen). Note that this code is basic — it won’t look super snazzy. For a more beautiful one, you’ll have to add some more lines of code specific to your needs.

While you can use just basic HTML, this isn’t the ideal option. This form doesn’t directly send to email addresses, but rather opens an email client or tool window to submit the form. This can spook the user out of submitting the form at all.

So, what HTML code allows you to send form submissions directly to an email address?

To make the form work with your email server and send it to a mailbox, PHP is the answer — let’s explore that option now.

Method 2: Create an Email Send Form Using PHP (Advanced)

To create a form subscribers can contact you with, the PHP script is going to be your best friend. I know, another acronym. This one stands for Hypertext Preprocessor, and this language collaborates with HTML to process the form.

Before jumping into the process, let’s break down a few form basics.

A webform has two sides: The front-end, seen in the browser by visitors, and a backend script running on the server.

The visitor’s web browser uses HTML code to display the form. When the form is submitted, the browser sends the information to the backend using the link mentioned in the “action” attribute of the form tag, sending the form data to that URL.

For example: <form action=>.

The server then passes the data to the script specified in the action URL — myform-processor.php in this case. Using this data, the backend script can create a database of form submissions, direct the user to another page (e.g. payment), and send an email.

There are other scripting languages you can use in the backend programming, like Ruby, Perl, or ASP for Windows. However, PHP is the most popular and is used by almost all web hosting service providers.

If you’re creating a form from scratch, here are the steps you can take.

Step 1: Use PHP to create a page.

For this step, you’ll need to have access to your website’s cPanel on your hosting platform.

When you’re creating a webpage, instead of using the “.html” extension, type “.php” instead. This is similar to what happens when you save an image as “jpg” versus “png”.

By doing this, the server will know to host the PHP you write. Instead of saving the empty HTML page as such, save it as something like this: “subscriberform.php”. After your page is created and saved, you’ll then be able to create the form.

Step 2: Make the form using code.

In this step, you’ll write the code to create the form.

If you’re not sure how to create forms in HTML, check out HTML Dog’s resource for a primer on the basics.

The following code is what’s needed for a basic form:

Because this is similar to the HTML-only write-up, these lines will also create a name for the form and an area for subscribers to type a custom message and send it to you.

An important difference is the action=”subscriberform.php” part. This portion of code is what will make the page send the form when submitted. Recall that in the first example, that wasn’t an option.

Step 3: Make the form send an email.

After you create the form and add all the proper fixings depending on your design preferences, it’s time to create the email portion.

For this, you’re going to scroll to the beginning of the page (the very beginning, even before defining the HTML Doctype). To enable sending data in the email, we have to add code that will process the data. Copy this code or create something similar:

Everything inside the first and last lines will tell the webpage to make these functions perform as PHP. This code also checks to see if a subscriber uses the form. From there, it checks to see if the form was sent.

Further breaking it down, “mail” sends the completed form as an email to “your@email.address,” and the subject line is what follows. In the next line, you can write a copy of the email message inside the quotes, to be sent from whichever email address you choose.

Once the form is submitted, the page sends the data to itself. If the data has been successfully sent, the page sends it as an email. The browser then loads the page’s HTML — the form included.

With that, you have the basic code you need to create the form.

Note that this is just one way to do this — alternatively, you can also create a form using a builder, and then embed it onto your website.

Method 3: Create an Email Send Form Using a Form Builder

If you’re not using WordPress to build your website and are not coding-savvy, you may be at a loss as to how you can create a form, especially if your CMS doesn’t offer a drag-and-drop page editor.

(Hot tip: A drag-and-drop editor can make it much easier and simpler to create an email-sending form. Try CMS Hub — it’s 100% free.)

Each of the below tools allows you to build a form that sends an email without any coding needed from you. The best part is that you don’t need to change content management systems if you don’t want to. Instead, you can embed the form onto your website using each tool’s embed code.

1. HubSpot: Best Email Form Builder Overall

HubSpot includes a form builder in the free tier of all of its products. Because HubSpot already has your email, it will automatically send you a message when a new entry is submitted.

HubSpot’s form builder is linked with other tools in the platform, including Marketing Hub and CMS Hub, and doesn’t require any previous technical knowledge. If you want to extend the form to include marketing capabilities, you can do so as well.

For example, you can build custom forms that connect to your contacts list. You can also customize those forms and trigger automatic emails based on the completion of your forms. Note that the latter requires a premium upgrade.

If you want to learn how to receive an email after a form submission, take a look at our Knowledge Base article.

2. Best Quick Email Form Builder allows you to quickly create a form in its drag-and-drop interface, then embed it on your site using HTML embed code. You’ll receive an alert or notification, and you can then manage responses in the tool’s backend. It’s free for 10 users, but if your company will need more seats, you can have access for $14.99/month.

3. Jotform: Best Email for Builder for Multiple Forms

If you expect that you’ll need more than one form, Jotform is a great choice. It gives you several options for embedding forms on your website: JavaScript, iFrame, or the entire source code of the form. You also have the option of creating a lightbox or popup form.

Jotform is free with its branding. Pricing starts at $24/month.

Check out more form builder tools here.

Method 4: Create an Email Send Form Using a Plugin

If you’re running a WordPress website, we have good news: You have a plethora of form builder plugins available to you, most of which come at the excellent cost of free. These tools will all send an email upon receiving a submission.

1. HubSpot Form Plugin: Best for Lead Generation

If you’re planning to use your form as a lead generation tool, then we highly recommend using the HubSpot form plugin. It links directly to your HubSpot account, allowing you to use it in conjunction with HubSpot CRM, Marketing Hub, Sales Hub, and more.

2. WPForms: Best for Embedding Anywhere

WPForms is a drag-and-drop form builder that allows you to configure it to email you upon receiving a submission. You can also embed the form anywhere on your site, including the sidebar and footer.

3. ARForms

ARForms allows you to receive email notifications based on conditions you’ve set, but you can also get email notifications for all submissions. You can also integrate it with other tools in your tech stack, including HubSpot, PayPal, and Google Sheets.

The Perks of HTML Forms that Send Emails

Whether you want to convert more visitors to leads, collect information for your sales team, or create more loyal brand advocates, forms are imperative to an inbound strategy. If you don’t have a form on your website, you could be missing out on more leads, higher conversions, and happier long-term customers.

The problem is that it’s easy to forget checking the responses, and even easier to get submissions but have no searchable record of them. Forms that send an email back to you keeps information in your inbox for reference and ease.

Editor’s note: This post was originally published in December 2019 and has been updated for comprehensiveness.