You are currently viewing How to Track URL Parameters in Ninja Forms and Get Data in Your Email

How to Track URL Parameters in Ninja Forms and Get Data in Your Email

  • Post author:

URL parameters are essential for tracking traffic sources and campaign performance. In this guide, we’ll walk you through adding URL parameters to your page and capturing them using Ninja Forms.If you’re new to forms and marketing campaigns, you may wonder how to capture information like where visitors come from, which campaign brought them to your website, or what keywords they searched for. This is possible by using URL parameters .

URL parameters are pieces of information added to a link to track specific details. For example:https://new.digitalmarketinglibrary.in/?utm_source=google&utm_medium=cpc&utm_campaign=newcampaign&utm_term=digitalmarketing

  • utm_source: Tells the source of traffic (e.g., Google).
  • utm_medium: Tells the type of traffic (e.g., CPC for paid ads).
  • utm_campaign: Tells the name of the campaign (e.g., “newcampaign”).
  • utm_term: Tells the keyword or search term (e.g., “digitalmarketing”).

When a visitor clicks this link and fills out a form on your site, the data from these parameters will be captured.

Important Points to Remember Before You Start

Important Points to Remember Before You Start

1.Original and Updated URLs Are Different:
If your original link is –  https://new.digitalmarketinglibrary.in/

And you add parameters like this –

Google will treat them as two different pages.

2 .Use the Updated URL for Specific Campaigns Only:
Use this updated URL in ads, emails, or anywhere you want to track details. For regular traffic or blogs, continue using the original link.

Step-by-Step Guide to Update the URL and Track Data

Step 1: Create an Updated URL

To create a link with URL parameters, use a free tool like the Google Campaign URL Builder. Here’s how:

  1. Open the URL builder tool (just search for it online like  chrome , google)

2. Enter your website’s original link (e.g., https://new.digitalmarketinglibrary.in/).

Fill out the parameters:

    • utm_source: The traffic source (e.g., “google”).
    • utm_medium: The type of traffic (e.g., “cpc”).
    • utm_campaign: The campaign name (e.g., “newcampaign”).
    • utm_term: The keyword or search term (optional).
campaign-url-builder-dashboard-image
  1. Copy the generated link, which will look something like this:
campaign-url-builder-dashboard-iamge

you can shorten the link just click on shorten link .

Step 2: Add Hidden Fields in Ninja Forms

Hidden fields allow your form to capture the parameters without showing them to users.

  1. Open Ninja Forms Editor:
    Go to your WordPress dashboard, navigate to Ninja Forms, and open the form you want to edit.
ninja -form-dashboard image

Add Hidden Fields:
Add one hidden field for each parameter:

after opening form click on “+” icon to Add new fields and look for Hidden option

 

ninja-for-hidden-option-dashboard -image

now click on the hidden field you just add here you’ll get label and default value option just add the parameter name and default value and click on done button .add other utm parameters by repeating this process.

just like this 

ninja-form-dashboard-with-utm-parameters-all

Step 3: Configure Email Notifications

Set up your form so that the captured data is included in the email you receive after submission.

  1. Go to the Emails & Actions tab in the form settings.
  2. Edit the email notification.
  3. Add the hidden field data to the email body:
  4. click on done button.

Step 4: Test Your Setup

    1. Open the updated URL with url parameters in your browser:
      1. Fill out and submit the form.
      2. Check your email. It should contain the UTM data, like the image shows below:
email-dashboard-image

Common issue:

The issue with your email showing {field:utm_source}, {field:utm_medium}, etc., instead of actual UTM data indicates that the form isn’t capturing the parameters correctly.

 1: Incorrect Hidden Field Setup:

Here’s how to troubleshoot and resolve it step by step:


 

  1. Go to your Ninja Form editor.
  2. Check that each hidden field has the correct Default Value set:
    • UTM Source: {querystring:utm_source}
    • UTM Medium: {querystring:utm_medium}
    • UTM Campaign: {querystring:utm_campaign}
    • UTM Term: {querystring:utm_term}
  3. Save the form after verifying these values.
  4. also check email notification field and save

if it still look the same .then you may have other cause .

2: URL Parameter Encoding Issue:

The issue arises because the equals sign (=) in your UTM parameters has been encoded as %3D. This encoding causes tools like Ninja Forms to misinterpret the parameter data. To fix this, you need to ensure the URL uses properly formatted UTM parameters.

Here’s how to troubleshoot and resolve it step by step:

1. Access a URL Builder Tool

Use any reliable URL builder tool like:


2. Recheck & if needed Enter the correct Information again

Fill in the fields provided in the tool:

  1. Website URL

    • Enter your base URL (e.g., https://new.digitalmarketinglibrary.in/enroll).
  2. Campaign Source (utm_source)

    • Specify the source of traffic (e.g., google, facebook, newsletter).
  3. Campaign Medium (utm_medium)

    • Define the medium used (e.g., cpc, email, organic).
  4. Campaign Name (utm_campaign)

    • Name the campaign (e.g., newcampaign, sale2024).
  5. Campaign Term (Optional) (utm_term)

    • Use this to track keywords if applicable (e.g., digitalmarketing).
  6. Campaign Content (Optional) (utm_content)

    • Specify different versions of ads or links if required.

3. Generate the URL

Once all fields are filled, the tool will automatically generate the complete URL with parameters.

Example Generated URL

email-dashboard-image

4. Use the Updated URL

  • Replace your old URL with this updated one wherever needed.
  • Use this updated URL in emails, social media, ads, or other campaigns.
  • ll required details.

5. Go to email​

Open Ninja Forms: Navigate to the form editor.

  1. Go to Emails & Actions: Select the email notification action.
  2. Locate the Email Body Field: It’s a text area where you can customize the email content.
  3. Add Placeholders: Use placeholders like:
    • Name: {field:name}
    • Email: {field:email}
    • Phone: {field:phone}
    • UTM Source: {field:utm_source}
    • UTM Medium: {field:utm_medium}
    • UTM Campaign: {field:utm_campaign}
    • UTM Term: {field:utm_term}

You can format the email body as you like using these placeholders, ensuring it captures all required details.

email dashboard image

I hope this help I know it can be overwhelming for beginners but trust me  it’s worth at the end just keep practicing face the problems  .more problems you will face today the better you will become tomorrow.

“Marketing’s job is never done. It’s about perpetual motion. We must continue to innovate every day.”
Beth Comstock
former CMO and vice chair, GE