Tracking UTM Campaign information in CRM

Tracking UTM Campaign information in CRM

Hi All,

We have had this questions asked a few times lately so thought it would be a great idea to post it here for others benefit. 

Many have asked this:
How can I track campaign information in CRM from my online campaigns and report on UTM tracking details? 

Below is what we have set up for other businesses who are using UTM Codes for all their campaigns. Follow the 4 steps below to set this up for your CRM:

1. Create Fields in CRM Leads Module

Add a field  in the Leads module called 'Referrer URL' (URL field type).

Added a section in the Leads module called 'UTM - Campaign Details' and add these fields (Single Line field type):
  • Campaign Name
  • Campaign Source
  • Campaign Medium
  • Campaign Term
  • Campaign Content
2. Create a Custom Function

Next you will need to configure a Custom Function that takes the UTM tracking details from the 'Referrer URL' and adds them to the UTM fields above in the Leads module. Here is the custom function code that you will need to also create in your CRM (to create a Custom Function go to CRM 'Settings' => 'Automations' => 'Actions' => 'Custom Functions' (on the top), then click 'Configure Function' button on the right):

Set this up for your Leads module.
Custom Function Name: Add UTM tracking details to Lead Fields

Argument Mapping - Name: leadId = Value: Lead Id

(copy and paste this code to your custom function. If you have set the Argument above exactly the same it should work for you)

getLeads = zoho.crm.v1.getRecordById("Leads",leadId);
referrerUrl = getLeads.get("Referrer URL");
info referrerUrl;
urlVal = referrerUrl.indexOf("?");
customVariables = referrerUrl.substring(urlVal + 1);
utm_source = "";
utm_medium = "";
utm_campaign = "";
utm_term = "";
utm_content = "";
formMap = Map();
for each  customVariablesArr in customVariables.toList("&")
{
var_s = getPrefix(customVariablesArr,"=");
val_s = getSuffix(customVariablesArr,"=");
if(var_s == "utm_source")
{
utm_source = val_s;
}
if(var_s == "utm_medium")
{
utm_medium = val_s;
}
if(var_s == "utm_campaign")
{
utm_campaign = val_s;
}
if(var_s == "utm_term")
{
utm_term = val_s;
}
if(var_s == "utm_content")
{
utm_content = val_s;
}
}
formMap.put("Campaigns Source",utm_source);
formMap.put("Campaign Medium",utm_medium);
formMap.put("Campaign Name",utm_campaign);
formMap.put("Campaign Term",utm_term);
formMap.put("Campaign Content",utm_content);
leadupdated = zoho.crm.v1.updateRecord("Leads",leadId.toString(),formMap);
info leadupdated;

3. Create a Workflow Rule to trigger the Custom Function

To run the above code a Workflow Rule needs to be created. We created a workflow rule WHEN a Lead is Created or is Edited to meet the condition:
Condition 1 - Referrer CONTAINS utm

Instant Action - (select the Function you created above) 

4. Create a hidden field in your online forms for 'Referrer URL' and map to your CRM Leads module

You will need to have a field added to your campaign forms that captures the 'Referrer URL' you set up for your UTM tracking. Add this field and then make it hidden and then map this form field to the 'Referrer URL' field in your leads module. 

That's it! Once you have this set up you can create reports in your CRM to report on any of the Lead UTM fields. 

Please let a comment if this post has been helpful to your business. We would love to hear from you!

If you need any help with this please send us an email to - zoho(at)s2s(dot)services.

Helping you achieve business and personal success using Zoho Products

Jason




      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • Multi-Select lookup field has reached its maximum??

                                    Hi there, I want to create a multi-select lookup field in a module but I can't select the model I want the relationship to be with from the list. From the help page on this I see that you can only create a max of 2 relationships per module? Is that true?
                                  • Zoho Mail API Error EXTRA_KEY_FOUND_IN_JSON

                                    I have a workflow set up in Pipedream that uses the Zoho Mail API to send emails from my account. It's worked without issue for months but today I'm getting the following 404 error for every email I try to send: { "data": { "errorCode": "EXTRA_KEY_FOUND_IN_JSON"
                                  • How to search (web API) for a Calls record by phone number?

                                    Using v8 /Calls/search web api I'm unable to to complete a search request no matter how I use the api: When I try using "criteria=" I get: response: <Response [400]> response_json: { "code": "INVALID_QUERY", "details": { "reason": "the field is not available
                                  • Can you limit who creates tags?

                                    Hi there, I'd like to find out if it's possible to limit which Agents create tags on Zoho desk. Thank you. 
                                  • GraphQL in new Send Webhooks feature

                                    Hello, is it possible to use GraphQL apis in the new Send Webhooks feature?
                                  • [Free Webinar] Product Release Updates - Creator Tech Connect

                                    Hello Everyone! We welcome you all to the upcoming free webinar on the Creator Tech Connect Series. The Creator Tech Connect series is a free monthly webinar that runs for around 45 minutes. It comprises technical sessions in which we delve deep into
                                  • Function #62: Display associated Quote on Invoice details screen

                                    Hello everyone! Today, we are sharing a Related List script that makes it easy to view and access the quote from which an invoice was created right from the invoice details screen. This Related List displays the Quote number and Amount, allowing you to
                                  • Introducing Zoho Commerce 2.0 — It's more than just selling!

                                    Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
                                  • Zoho GenAI API Error Not a valid response from zia.

                                    Zoho GenAI API Error Not a valid response from zia.
                                  • Help me to retreive my Document

                                    Please help me to retrieve my documents from any date between 1st February, 2025 to 20th,March 2025 .it got mistakenly deleted on the 21 of March 2025 due to phone screen malfunction I earnestly await your positive response .thank you
                                  • how to change the page signers see after signing a document in zoho sign

                                    Hello, How can I please change the page a signer sees after signing a document in Zoho Sign? I cannot seem to find it. As it is now, it shows a default landing page "return to Zoho Sign Home". Thanks!
                                  • Look Up Field Type not available for events and tasks?

                                    Look Up Field Type not available for events and tasks?    
                                  • I cannot check out to Zoho People.

                                    When I tried to check out today, there's prompt that inhibits me to check out: To add entry in Attendance, log time for any of your jobs
                                  • Digest Juin - Un résumé de ce qui s'est passé le mois dernier sur Community

                                    Bonjour à toutes et à tous, Ce mois-ci encore, tout s’est enchaîné à toute vitesse ! On vous fait un petit récap de ce qui a marqué ces dernières semaines. Zoho RPA est une solution robuste d’automatisation des processus, conçue pour s’intégrer aux systèmes
                                  • Different Transaction Series for Different Types of Sales

                                    Is there any way I can create multiple transaction series for different type of Sales? Say B2B-001 and B2C -001 for respective type of Sales.?
                                  • Unable to charge GST on shipping/packing & Forwarding charges in INDIA

                                    Currently, tax rates only apply to items. It does not apply tax to any shipping or packing & forwarding charges that may be on the order as well. However, these charges are taxable under GST in India. Please add the ability to apply tax to these charges.
                                  • Customer Advance Zoho Book API

                                    All I could find was Customer Payment API, it does not have facility to add customer advances, where those are not linked to any invoice as such. How to do it?
                                  • Even though the received amount+tax is equal to or lesser than the invoice value, zoho doesnt allow to record

                                    Even though the received amount+tax is equal to or lesser than the invoice value, Zoho mentioned the error- you've recorded more payment than the actual invoice balance. please check again. screenshot also attached.  You've recorded more payment than
                                  • Multiple deductions in invoice

                                    I issue invoices to a customer that include multiple deductions that I would like to track in different expense accounts. But that is not possible in Zoho Books as there is only one Deduction field and even that I don't have control over to assign it
                                  • #BiginnersTips | How to bulk update closing dates for multiple deals in Bigin

                                    Hello Biginners! Keeping your CRM data accurate is crucial for any business- big or small. One key aspect is ensuring that closing dates for deals are always up to date. Why? Because if a deal is closed but not updated, your dashboards and reports would
                                  • 采购里出现付款通知 的错误

                                    采购里面出现付款通知错误,怎么调整,我找不到路径,好像是ZOHO 自动生成的,请问怎么调整
                                  • {"code":1002,"message":"Statement of Accounts does not exist."}

                                    Hello Zoho team, I faced an issue while trying to POST a sales order from sap to zoho books, using the below data packet: {   "customer_id": "4322967000027451968",   "line_items": [     {       "item_id": "2154170000010847685",       "rate": "752.00",
                                  • Add Custom Fields only in Customer module and not on supplier module!? Is not there a way to do that!?

                                    I am trying to create custom fields on clients module but it also gets created on suppliers module; which of course does not make sense at all as a lot of custom fields are client or supplier specific but never both. I am missing something? This seems
                                  • Logging website service fees

                                    Hello, I do a lot of freelance work on sites like Upwork and Wyzant and others and those companies take a small cut from what I pay or what I earn and I am wondering what is the correct way to log this in my books. For example if I charge $55 per hour
                                  • Allowing vendors to Upload Purchase Invoices against Purchase Order

                                    Work Flow: Once Project is executed, We send Purchase order to every Vendors asking them to Share the invoice against the same. Most of the time Vendors Send invoices through Mails but our Finance Team miss to book those Purchase Invoices in Zoho Books.
                                  • How do i clear a liability account without making a payment?

                                    I have a liability account with a provision for an expected bill from previous years. However the bill never arrived and the provision/liability account with Cr balance has been carried forward for many years now. How do i know clear the provision made
                                  • 2 Transactions for single Expense

                                    I have make 2 payments and have 1 Invoice containing both the items. My Bank Feeds show 2 Transactions, How can i associate them with Single Expense? I tried adding them to Advance Payment, but advance payment I can only apply to Bills It seems. Why cant
                                  • Everything AI in Zoho Recruit – Webinar Recording Available!

                                    AI is transforming the way recruiters find, engage, and hire top talent. In our latest webinar, we explored how Zoho Recruit’s AI-powered features can help streamline hiring, automate workflows, and improve decision-making. Missed the session? No worries
                                  • Kaizen #131 - Bulk Write for parent-child records using Scala SDK

                                    Hello and welcome back to this week's Kaizen! Last week, we discussed how to configure and initialize the Zoho CRM Scala SDK. This week, we will be exploring the Bulk Write API and its capabilities. Specifically, we will focus on executing bulk write
                                  • Introducing the FTP task in Deluge

                                    Hello everyone, We're excited to announce the launch of the FTP task, a powerful addition to Deluge that enables you to effortlessly transfer files between various Zoho apps and your own servers. Unlike the invokeUrl task, which supports various HTTP
                                  • The Social Wall: June 2025

                                    Hello everyone, We’re back with June Zoho Social highlights. This month brought some exciting feature updates—especially within the Social Toolkit—to enhance your social media presence. We engaged with several MSME companies through community meet-ups
                                  • Create PDFs with Text so that we can copy from a generated PDF

                                    Currently, any information that a user enters into a field cannot be highlighted and copied from the PDF that Zoho Sign renders. For example, if someone were to provide a phone number in a Zoho Sign text field, you would not be able to copy the phone
                                  • Anyone Building AI-Based SEO Dashboards in Zoho Analytics?

                                    Hey everyone, I’m currently working on an SEO reporting dashboard in Zoho Analytics and looking to enhance it with AI-based insights—especially around AI visibility, keyword trends, and traffic sources. The goal is to track not just traditional metrics
                                  • Custom widgets on Zoho one dashboard

                                    Is it possible to create custom widgets on the Zoho One dashboard? I see there is a widget name My Open Tickets to display open tickets in my view, but I would also like to have a widget to display unassigned tickets. A widget to display unfinished projects
                                  • Format of data after export to spreadsheet

                                    Dear Zoho, can you explain to me what is the point of a report exporting to XLSX if the format of the amounts that will be created there is in text format and not suitable for anything? Why do I need data in a sheet with which nothing more can be do
                                  • Data privacy concerns

                                    Does Zoho team have access to my data in the database e.g. Balance Sheet, Bank account transactions, Profit & Loss statement etc.
                                  • Ability to Remove/Change Zoho Creator Admins via Zoho One Interface

                                    Dear Zoho One Team, Greetings, We would like to request a feature enhancement in Zoho One. Currently, it is not possible to remove or downgrade a user with the Admin role in Zoho Creator from the Zoho One admin interface. Unlike other Zoho apps where
                                  • Zoho Sheets

                                    Are they ever going to set up the feature "where I left off" just as you can do in Microsoft Excel online ? For me that is the only feature missing from Zoho sheets other than that I think they are terrific and use them every day. I only occasionally
                                  • Canvas Detail View Related List Sorting

                                    Hello, I am having an issue finding a way to sort a related list within a canvas detail view. I have sorted the related list on the page layout associated with the canvas view, but that does not transfer to the canvas view. What am I missing?
                                  • Mass Update in Zoho CRM

                                    Hello, I want to update my past update records by using deluge on some conditions. anyone can please tell me how can I do it.
                                  • Next Page