How to implement Zoho PageSense custom events through GTM | User guide

Implement the Zoho PageSense custom events through GTM


The custom events feature in PageSense allows you to track and record visitors' actions on your website that are not exclusively related to clicks or page views. This mostly involves tracking user interactions on webpages that do not generate a new destination page URL or confirmation page URL upon successful completion of an event or task.
For example, let's say your website contains an enquiry form that does not send visitors to a unique confirmation page upon successful submission of the form. In this case, you can implement a custom event in PageSense to track successful submissions of this form rather than just clicks on the button.  Or, let's say you have attached a multi-step sign up form on your site where the user moves through various steps to complete the signup process but unfortunately the URL of the page does not change. In this case, you can implement a custom event to track if your form was successfully submitted or not. 

If you're using GTM to integrate with Zoho PageSense, you can easily add and track a number of different PageSense custom events or user interactions on your website by configuring individual tags and trigger conditions in GTM. Whenever a particular custom event tag is triggered in GTM, it executes the respective PageSense custom event and records a successful conversion into your experiment report.

Make sure that you add the PageSense tracking snippet on all the web pages where the custom event is triggered.

To add the PageSense custom event code in GTM:

1. Login to your Google Tag Manager account, go to the left pane, click Tags, then click the New button at the top-right corner.

2. In the Untitled Variable field, enter your tag name that is relevant to the custom event you want to track.
For example, let's say you want to track the clicks on the "Add to Cart" button of your shopping site that does not lead to a unique confirmation page URL or the checkout page when visitors add an item to their cart. So, we'll call it: "Add to cart - PageSense custom event"



3. Click the
Tag Configuration icon, then select Custom HTML as the tag type from the list.


4. Copy-paste the PageSense custom event code snippet generated in PageSense inside the HTML window as shown below.

Here is an example of code generated in PageSense that is needed to trigger a custom click event goal on the page. Learn how to create a custom event goal in PageSense.

<script>
window.pagesense = window.pagesense || [];
window.pagesense.push(['trackEvent', 'Add to cart']);
</script>
 


Also, here is an example of code generated in PageSense that is needed to trigger a custom form submission event on the webpage. Learn how to create a custom form event in PageSense.
<script>
window.pagesense = window.pagesense || [];

window.pagesense.push(['trackEvent', 'submit']);
</script>


5. Click the trigger icon and choose an appropriate trigger type that is suitable for your use case.
There are 14 default triggers that can be used to trigger tags. Furthermore, GTM allows you to combine these triggers for robust control and detailed firing.



Let's now look at two different examples to understand how to choose a trigger type.
Example 01: Tracking button clicks on a single page application
Let us reconsider the example quoted above. Say, you have an "Add to Cart" button on your shopping site and this CTA simply launches an overlay popup or shows an on-screen message once the product has been added to the cart. Now, you want to know successful clicks on this button as they don't redirect to the checkout or any confirmation page URL.




In this case, you can select th
e All Elements as the trigger type to track the number of conversions obtained on the "Add to Cart" button of your shopping website as explained below:
  1. Click the plus icon (+) at the top right corner, enter a name for your trigger and choose the trigger type as All Elements. 


  2. Select Some Clicks (since we already set our mission to track that specific click) and specify the conditions and definitions as follows: Click Element---> matches CSS selector -> Copy-paste the element's selector.



    To copy the element selector from your web page: right-click on the CTA element you want to track and select
    Inspect. Again, right click on the highlighted code, select Copy Selector and paste the same in the value box as shown in the figure.


    Now, the custom event tag configured through GTM will trigger the click event goal in PageSense as soon as a visitor clicks the "Add to Cart" button on your website. This records the total number of visitors coming  to your site along with the percentage of visitors who successfully clicked this CTA into your PageSenses' experiment report.

    Furthermore, the report lets you filter and segment your
    data based on different audience criteria and the type of items in the cart like the size, color, product model and much more. Using the Click Element trigger type in GTM, you can also track many other important user actions on your ecommerce store like removing items from a cart, adding items to a wishlist, and returning or exchanging items to store.
Similarly, you can implement custom funnel events in GTM using the Click - All Element trigger type to track the number of visitors who complete each stage of your conversion process.
For example, let's say you have a buyer's journey funnel on your shopping website where your potential customers have to go through four stages: homepage--->product page--->cart page--->checkout page to complete a purchase. Now, you want to track clicks on the checkout button that does not redirect to a "thank you" page or confirmation page URL upon successful purchase of a product but instead shows a thank you popup message in the same URL.
In this case, you can configure the custom click event trigger on the 'Checkout' button of your shopping site to track the funnel completion as shown in the figure below. You can also create different triggers for each step of the funnel that is activated by clicking on the respective buttons.


Example 02: Tracking form submissions (using DataLayer Events) with no unique confirmation page or 'thank you' page URL.
Let's say you have a 'Contact Us' form on your website that does not lead to a unique confirmation page or "thank you" message page upon successful submission of the form by visitors. Now, you want to track the actual submissions and abandonment rate by visitors who're filling out the form.


In this case, you can select Custom Event as the trigger type to track the successful Contact form submissions as explained below:
  1. Click the plus icon (+) at the top right corner and choose the trigger type as Custom Event.


  2. Under the Event name field provide a name for your form event, for example - "contactFormSubmission" for the contact form and select All Custom Events.


In addition to this, you also need to add the below highlighted code in the POST success function of the 'Submit' button in your Contact Us Form available on your website.

Here is an example of code displayed for the success function of the 'Submit' button on the Contact Us page of the website. While you add this code to your site, make sure you provide the event name as already mentioned under the 'Trigger Configuration in GTM' (for example: 'Event': 'contactFormSubmission')

<script>

      function submitForm() {

      var xhttp = new XMLHttpRequest();

      xhttp.onreadystatechange = function() {

            if (this.readyState == 4 && this.status == 200)
            {

     window.dataLayer.push
({

     'event':''contactFormSubmission''

 });

 }

 };

  xhttp.open("GET", "/", true);

  xhttp.send();

}

</script>

Once your visitor submits the form, it will trigger the respective Custom form event in PageSense and start recording different form (and field) metrics like total visitors, number of successful and failed submissions, form abandonment rate, average time spent on form and munch more information under your PageSenses' experiment report.

6. Once done configuring the tag and trigger condition, click Save in the top right corner.



7. Now, click the Submit button on the top-right corner then enter the version name and description for the changes made.
You can also click on the Preview button to check your tags for basic errors and to verify that your tag launches on that specific click before actually publishing it.
8. Finally, click Publish to publish the tag and trigger your custom event code on your experiment pages.


    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION






                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          Offline Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel
                          Prefill Forms Non-Profit

                          Intake Forms Legal

                          Form Designer HR

                          Card Forms Food
                          Assign Forms Photography

                          Translate Forms Real Estate
                          Electronic Forms

                          Notification Emails for Forms Alternatives
                          Holiday Forms Google Forms alternative 
                          Form to PDF Jotform alternative





                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Integrate Google Analytics with Zoho PageSense via Google Tag Manager

                                                                                                                You can effortlessly integrate Google Analytics (GA) with Zoho PageSense using Google Tag Manager. GTM is a free tool that allows you to quickly add and update your code (tags) on your website without having to manually write a single line of code. ...
                                                                                                              • Install the PageSense code snippet using Tag Manager

                                                                                                                If you're using Google Tag Manager (GTM) to integrate with Zoho PageSense, you can use the PageSense tag available in the tag list to quickly install the code snippet on your website instead of manually adding them every time. Once you add the tag, ...
                                                                                                              • Create a custom event form analytics

                                                                                                                Sometimes, when submitting a form on your web page, you might not have a thank you or confirmation page to track successful visitor conversions. In these cases, you can implement a custom event into the success function of your AJAX request to ...
                                                                                                              • Create a custom event in funnel analysis

                                                                                                                Funnels are used to track events and task completions by visitors between different stages in your website. By creating custom event funnels, you can track visitor clicks in every stage of your funnel page which does not contain a unique thank you ...
                                                                                                              • Setup your Zoho PageSense account

                                                                                                                Zoho PageSense provides you with the right set of tools to test personalized website experiences, track user's key metrics, and further analyze their behavior on your website in real time to boost visitor conversions. To sign up with PageSense, all ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources