Instant Estimate +44(0)1908738254
YOUR EXPERT RPA PARTNER

Team up with our RPA strategy and tech specialists for maximum automation impact

Find out more
Harness the power of UiPath in your business.
WATCH NOW

Save money and spend more time on priority work.

Book consultation
READY, SET, AUTOMATE

Let's choose, design and deploy a process automation solution for your business.

Find out more
TRANSFORM YOUR BUSINESS

Let's analyse your business to discover opportunities for innovation and automation.

Find out more

Begin your business transformation journey

Book consultation
AUTOMATE EVERY FUNCTION

Automate where it matters most. Scale to solve challenges in every area

Find out more
GIVE EVERY TEAM THE TOOLS FOR SUCCESS

Equip people with user-friendly solutions that save time and make work easier

Find out more

Which business problem
can we solve first?

Book consultation
11 September 2018

Enabling Google Analytics in a K2 SmartForm

Adding Google Analytics in a K2 SmartForm is just as easy as enabling it on a conventional web application. This process can be further simplified when using a common view within the K2 application. 

K2 Automated Testing Software

BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.

 

Step 01

Log in and locate the existing Google Analytics site Tracking ID. Not yet step up Google Analytics? Then go ahead and create and set up a Google Analytics account  and make a note of the newly created Google Analytics Tracking ID.

Step 02

Create a common view that can be reused on all or most of the forms; this would typically be a header view, but can also be a hidden view.

By making use of a common view, it is only neccessary to add the Google Analytics tracking code to a single view, the result being that all pages making use of this view will then be automatically tracked.

Step 03

Add a data label to the common view (anywhere on the view)

 Data Label Control

Data Label Control

Data Label Layout

Data Label Layout

Step 04

Update the properties of the data label to:

  • Visible – unchecked
  • Literal – checked

Data Label Properties

Data Label Properties

Step 05

While the data label is selected, click on the expression picker in the ‘General’ section of the control’s properties.

Add a new expression and give it a unique name. Now add the Google Analytics tracking script to the Expression Details section.

Data Label - Expression

Data Label – Expression

Step 06

Replace the GA_TRACKING_ID sections in the script with the Google Analytics tracking ID. The script should contain the correct GA tracking ID for the site.

Expression

Edit Expression Details

<script async src=”https://www.googletagmanager.com/gtag/js?id”GA_TRACKING_ID “></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘GA_TRACKING_ID ‘);
</script>

Google Analytics Tracking Script

Step 07

Click ‘OK’ and look at the data label’s properties to ensure that the newly created expression has been associated with the data label.

Data Label Properties

Data Label Properties

Step 08

Save and check in the view. Add the view to all K2 SmartForms that should be tracked. When running each of these forms data should start appearing on the real-time reports in the Google Analytics dashboard (shown here).

Real Time Google Analytics Report

Real Time Google Analytics Report

Google Analytics Report

Google Analytics Report

 Sample Google Analytics Report

Sample Google Analytics Report

In Summary:

  • The Google Analytics tracking code will be applied to all forms that use the common view
  • The same method can be used to add a data label with the tracking code to any other page or view
  • All page visits from a machine with internet access will be tracked if the tracking code has been added

Need further technical advice or support?