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



    Access your files securely from anywhere



                          Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner





                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ










                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • Zoho Finance Limitations 2.0 #15: You can't filter any Sales Orders by their SubStatus in CRM or Analytics.

                                                                                                              All our sales orders move through various stages and it's nice when you can filter by open orders in "50% Building"  or "100% - Built" however this is not possible in CRM finance. It's a basic feature within native CRM using a picklist. My go to was Analytics,
                                                                                                            • Why ZOHO Function Can't Read Custom Field API In Quotes Module (Subform)

                                                                                                              I’m using a Deluge function to transfer data from a subform in the Quotes module to a subform in the Accounts module. Everything works except for a custom picklist field in Quotes—no matter what I try, the Zoho API can’t read that field ("Status_sb").
                                                                                                            • 10 workflows automatisés pour booster votre conversion

                                                                                                              Le parcours client n’est plus une ligne droite. Aujourd’hui, les acheteurs prennent le contrôle : ils explorent les réseaux sociaux, consultent des avis, visitent des sites web et interagissent directement avec les marques. Ils ne se contentent plus d’écouter
                                                                                                            • How to Update custom Fillable Fields via Zoho Contracts API

                                                                                                              Our requirements for populating contract from CRM requires passing values form multiple record types (Deals and itemised Related Lists, Proposals etc). The Contract extension for CRM is great, but these do seem to be beyond it's design or capability.
                                                                                                            • ABILITY TO LOG INTO CUSTOMER PORTAL

                                                                                                              I think it would be very helpful to have a button in Zoho Books to be able to see the customer portal so we can see what they see to help them navigate through the portal. Many times, the customer will call about the portal, but without visibility into
                                                                                                            • How to get the call recording external ID via desk API

                                                                                                              I have enabled phonbridge integration with Zoom Call. I am trying to access the call recording in Zoom by calling Zoom API. I have built a Desk workflow to trigger on a new call, to call a custom function. when calling the API, the response doesn't contain
                                                                                                            • Quoted item subform setup button missing to add back unused field. (Zoho CRM professional edition)

                                                                                                              With Zoho CRM professional edition, understand that we couldnt further customize subform. But i notice there is no setup button for me to add back unused field that i accidentally removed (Tax field). it doesn't appear on left panel unused field as well.
                                                                                                            • Article Numbers for KB articles

                                                                                                              Hello, I was wondering if it's possible to turn on article numbers/ part numbering for KB articles. If this is not already a feature, we'd like to request it. Frequently a solution will require multiple articles so tracking which articles are referenced
                                                                                                            • Introducing Assemblies and Kits in Zoho Inventory

                                                                                                              Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
                                                                                                            • Como se guardan las imagenes que se cargan desde el Zoho Forms a Drive o Workdrive

                                                                                                              ¿Cómo puedo usar Zoho Flow para tomar un archivo subido en un formulario de Zoho Forms, extraer su ID de la URL y luego copiar ese archivo a una carpeta específica en Zoho WorkDrive de manera automatizada?
                                                                                                            • Zoho Projects API - Searching Projects by Custom Field

                                                                                                              Hi How can I search all projects by a custom field? I can confirm that using the search_term parameter as documented here does not work for me: https://www.zoho.com/projects/help/rest-api/search-api.html#alink3 My search term is "22424", which corresponds
                                                                                                            • Leave request for 0 hours is registed as 24 hours

                                                                                                              I have configured workschedules for all my employees, so the leave request for them whould be a lot easier. In that spirit I have configured a shift from 9 to 9 with a total duration of 0 hours. When a employee fills in a leave request for lets say a
                                                                                                            • Seeking Business/Operations Analyst with Strong Zoho Creator Skills

                                                                                                              Job Title: Business/Operations Analyst-Zoho Creator Specialist Location: Kansas City, MO (On-site) Company: SkyMark Refuelers About Us: SkyMark Refuelers is a leading manufacturer based in Kansas City, known for delivering high-quality aviation fueling
                                                                                                            • Limit POP Downloads to Inbox?

                                                                                                              Hello, When I connect to and download email from my account using the POP3 protocol, it appears that it's also downloading email from my Sent mailbox. Is there any way to limit the POP downloads to Inbox emails only? Thanks!
                                                                                                            • Recurring Events Not Disappearing from Zoho Calendar When Canceled by Organizer

                                                                                                              I receive a recurring meeting invitation to my Gmail address, The event correctly appears in my Zoho Calendar, since I have Gmail calendar integrated/viewable via Zoho Mail. When the organizer cancels one occurrence, the canceled meeting does not disappear
                                                                                                            • How Can I change admin account Email?

                                                                                                              Hi, I want to change admin email address for my account (I'm using Zoho Mail). How can i do this? Thanks!
                                                                                                            • Free Plan mail accounts details

                                                                                                              In the zoho mail pricing there's a free plan that includes: FREE PLAN Up to 25 Users 5GB* /User, 25MB Attachment Limit Webmail access only. Single domain hosting. I need to make sure that I'm able to create multiple email accounts in the form of: name@domain.com
                                                                                                            • Can't remove old phone number from Zoho email account and add a new one?

                                                                                                              Every time I try to add my new number it supposedly sends me a code which I never get and I still don't know how to remove the old number.
                                                                                                            • Many Deals to one Contact - Syncing issue

                                                                                                              Hi, In our CRM we have multiple deals to a contact. We have a field in deals called "Contract Type" - sometimes they are "business" and sometimes they are "personal" deals. I want to be able to send different emails to contacts depending on this field.
                                                                                                            • Unlock More Power with Zoho CRM's Enhanced Saved Filter Limit

                                                                                                              Dear Customers, We're happy to share some wonderful news for our valued users in the Enterprise and above editions of Zoho CRM. You must already be aware of the "saved filters" feature in Zoho CRM. Saved filters are custom search criteria that you can
                                                                                                            • Open a popup window from inside Record A and stay on the record after saving Record B

                                                                                                              Hello community, Perhaps you can help me with the following topic. I have a form A with a decision box. When this decision box is checked, a form B pops up. Once Form B is saved, I need to stay on Form A to continue entering data. I've observed the following
                                                                                                            • How to integrate single-sign-on using Linkedin in Zoho Creator

                                                                                                              How to integrate single-sign-on using LinkedIn in Zoho Creator need step by step integration.
                                                                                                            • Stage-Probability Mapping

                                                                                                              How do I answer this question in analytics? What is the Closed-Won percentage of all Deals that reach a given stage? Another way: Of all Deals that reach a given stage (eg. Artwork/Price Quote), what percentage of them become Closed-Won? I want to populate
                                                                                                            • Generate a Zoho Sign link

                                                                                                              From time to time I get a response "I never received your you e-document for electronic signature" is there a way to generate a Zoho Sign link to share.
                                                                                                            • What’s New in Zoho Expense: January - March 2025

                                                                                                              Hello users, We're excited to bring you the latest updates and improvements we've made to make your travel and expense management smoother and more effortless. Let's take a quick look at the important updates we've rolled-out in Zoho Expense between January
                                                                                                            • Ask the Experts 19: Live Expert Panel Discussion - Inside Zoho Desk Spring Release 2025

                                                                                                              Hello again! Have you ever needed quick insights into key indicators to help manage and streamline specific operations? Have you started using AI to enhance your customer service in Zoho Desk? From configuring simple bots using Guided Conversations to
                                                                                                            • Onboarding Zoho sign documents?

                                                                                                              I was wondering something about using the Zoho sign integration with the candidate onboarding process. We set up the entire onboarding process and we have added documents that the candidate needs to review and sign digitally using Zoho Sign. This part
                                                                                                            • Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.

                                                                                                              Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.
                                                                                                            • DKIM record Missing

                                                                                                              zoho says 'DKIM record missing' at the zohomail spf and dkim validation page. dkim record is most certainly in the wix dns settings. anyone had this issue?
                                                                                                            • zohomail - sending faxes via email using thexxxxxx@faxage.com format

                                                                                                              anyone doing this? zohomail - sending faxes via email using thexxxxxx@faxage.com format we do every so often send faxes using faxage.com
                                                                                                            • Permissions on Views

                                                                                                              Having the option of any agent creating custom views is firing back and got a situation where there are a hundred different views across the team and tickets are not being dealt in the most efficient of ways.  Tickets seems to be missed by some agents, whislt others have customized their columns in a way that due dates are not visible and not being respected. There needs to be control on this function in order to have a standard set of views and the ability to prevent users from performing customizations
                                                                                                            • Looking to Hire: Zoho Creator Developer for Vendor Dashboard Portal

                                                                                                              We are a Florida-based licensed liquor distributor using Zoho Books, Inventory, CRM, and Analytics. Many of our vendors are also our customers. We’re looking to build a centralized, secure Vendor Dashboard Portal in Zoho Creator that gives access to real-time
                                                                                                            • What is Resolution Time in Business Hours

                                                                                                              HI, What is the formula used to find the total time spent by an agent on a particular ticket? How is Resolution Time in Business Hours calculated in Zohodesk? As we need to find out the time spent on the ticket's solution by an agent we seek your assistance
                                                                                                            • Repeating Images in Emails

                                                                                                              Some emails have images that are repeated when viewed both on the web client (mail.zoho.com) and when using the Zoho Mail android app. It looks like perhaps some of the email styling is being ignored or applied incorrectly, as a brief inspection of the
                                                                                                            • Can we customize the default client-facing icons?

                                                                                                              Is there any way to customize the client-facing icons that display in the Zoho Bookings UI?  For example, I'm using the Default page theme and would like to modify the default icon that is shown beside "Service."  The icon currently being shown looks like a baseball hat to me (see attached screenshot) which has no relevance to my business or clients. It would be great if Zoho could provide a different, more generic icon (perhaps a bell icon to represent service?) or better yet allow the icons to
                                                                                                            • Quick Create needs Client Script support

                                                                                                              As per the title. We need client scripts to apply at a Quick Create level. We enforce logic on the form to ensure data quality, automate field values, etc. However, all this is lost when a user attempts a "Quick Create". It is disappointing because, from
                                                                                                            • How to change the default module A"leads" to customised module "abc" in Zoho while integrating the leads from Skrapp!

                                                                                                              How to change the default module A"leads" to customised module "abc" in Zoho while integrating the leads from Skrapp!
                                                                                                            • Estimating Project Costs in Zoho Projects – Based on Hours and External Costs

                                                                                                              Hi everyone, I'm currently setting up a project in Zoho Projects and working on implementing a budgeting structure. I’ve already enabled cost tracking based on hours logged to tasks, but I’m looking to expand this to estimate total actual costs, based
                                                                                                            • Zoho Payroll's USA and KSA editions are available in Zoho One!

                                                                                                              Greetings! We’re excited to share that Zoho Payroll, currently available only in India and the UAE, is now introducing the KSA (Kingdom of Saudi Arabia) edition and the USA (United States of America) edition, and these editions are now available in Zoho
                                                                                                            • Zoho CRM Forecast - Exclude certain Deals

                                                                                                              We have our forecast and we use it for team forecast/targets/attainment. It works great for that. However, occassionally we have to offer Deals that are non-revenue generating, but are tracked in our CRM. They still have revenue tied to them, but our
                                                                                                            • Next Page