Skip to content

Implement and Verify Code

Abstract

This document is a guide to implement and verify WOGAA Tracking Code v2 on your site

Warning

Do not reshare this document with anyone unless they need to implement WOGAA tracking on their websites


Latest Version

The latest version of WOGAA Web Analytics Tracking code is on WOGAA.JS v2.


Overview

The WOGAA Tracking Code needs to be implemented within your site in order to start collecting data. This guide will take you through the steps to implement and verify WOGAA.JS v2 code for testing in a Staging Environment and for live deployment on your Production Environment.

  1. Implement and Verify Code in Test Environment
  2. Implement and Verify Code in Production

Attention

In order to ensure the integrity of data collected, please ensure that you use the Correct Tracking Code for your Production and Non-Production (such as Development, QA, Staging - whichever applicable) environments.


Implement and Verify Code in Test Environment

Step 1. Register your Test Environment

  • To register your test environment you will need to login to wogaa.sg
  • Navigate to the specific Information Service under the Manage Services tab
  • Select the Test Environment tab
  • Select Register Test Environment to register your respective test environment's domain/URL

Screenshot 2019-11-25 at 6 23 40 PM

  • After registration, proceed to Step 2 to insert tracking code into your registered environment.

Step 2. Insert Tracking Code

Click on Copy to Clipboard to insert the following Tracking Code into the <head> section of every page of your website, before other scripts.

<script src="https://assets.dcube.cloud/scripts/wogaa.js"></script>

Example

<html>
  <head>
    ...
    <script src="https://assets.dcube.cloud/scripts/wogaa.js"></script>
  </head>
  ...
</html>

Info

The tracking code does not support subresource integrity (SRI). Please do not enable SRI for tracking code.

Step 3. Verify Test Environment

Once you have implemented the tracking code correctly, you will need the Chrome extension Adobe Experience Cloud Debugger to verify if your tracking code is working correctly.

  1. Install Adobe Experience Cloud Debugger in your browser. adobe-debugger
  2. Navigate to the website with the tracking code.
  3. Open the Adobe Experience Cloud Debugger extension.
  4. Navigate to the Analytics tab in the Adobe Experience Cloud Debugger and clicks on Clear All Requests.
  5. Refresh the website and check if there is any data in the Hits section.
  6. If the implementation is correct, there should be a set of data (Report Suites).
  7. Perform a few link clicks and pageviews and you will see the Adobe Analytics output in the console.
  8. The output displays what is getting sent to Adobe Analytics.

adobe_debugger_ss

Once you have followed these steps, we'll need you to send the following details for us to verify on our end.

Email Template for Verification in Test Environment

Please fill in the template below and email WOGAA NCS Support at wog.aa.support@ncs.com.sg

  • Informational Service Name:
  • Informational Service URL:
  • Environment: Testing (e.g. Staging)
  • Attachment: Screenshot taken from Adobe Debugger (optional)

Implement and Verify Code in Production

Step 1. Insert Tracking Code

Insert the following code into the <head> of every page of your website, before other scripts.

<script src="https://assets.wogaa.sg/scripts/wogaa.js"></script>

Example

<html>
  <head>
    ...
    <script src="https://assets.wogaa.sg/scripts/wogaa.js"></script>
  </head>
  ...
</html>

Info

The tracking code does not support subresource integrity (SRI). Please do not enable SRI for tracking code.

Step 2. Verify Production Environment

Once you have implemented the tracking code correctly, you will need the Chrome extension Adobe Experience Cloud Debugger to verify if your tracking code is working correctly.

  1. Install Adobe Experience Cloud Debugger in your browser. adobe-debugger
  2. Navigate to the website with the tracking code.
  3. Open the Adobe Experience Cloud Debugger extension.
  4. Navigate to the Analytics tab in the Adobe Experience Cloud Debugger and clicks on Clear All Requests.
  5. Refresh the website and check if there is any data in the Hits section.
  6. If the implementation is correct, there should be a set of data (Report Suites).
  7. Perform a few link clicks and pageviews and you will see the Adobe Analytics output in the console.
  8. The output displays what is getting sent to Adobe Analytics.

adobe_debugger

Once you have followed these steps, we'll need you to send the following details for us to verify on our end.

Email Template for Verification in Production

Please fill in the template below and email WOGAA NCS Support at wog.aa.support@ncs.com.sg

  • Informational Service Name:
  • Informational Service URL:
  • Environment: Production
  • Attachment: Screenshot taken from Adobe Debugger (optional)

Verification is not working

If your verification is not working after you have implemented the Tracking Code, there are a few reasons this could be happening. Below are the common issues and how to resolve them.

  • Content Security Policy (CSP) is blocking the WOGAA Tracking Code

    Solution: In order for WOGAA Tracking Code to work properly in the Production and Non-Production Environment(s), you need to whitelist the Content Security Policy (CSP). If your website has CSP enabled, update your CSP with the following code.

Test Environment CSP

default-src 'self' https://*.dcube.cloud/ https://*.demdex.net/ https://cm.everesttech.net/ https://wogadobeanalytics.sc.omtrdc.net/;
script-src 'self' blob: https://*.dcube.cloud https://assets.adobedtm.com/;
img-src 'self' data: https://wogadobeanalytics.sc.omtrdc.net/ https://cm.everesttech.net/ https://dpm.demdex.net/;
connect-src 'self' https://*.dcube.cloud https://dpm.demdex.net/;
style-src 'self' 'unsafe-inline' https://assets.dcube.cloud/fonts/;
font-src 'self' data: https://assets.dcube.cloud/fonts/;

Production Enviroment CSP

default-src 'self' https://*.wogaa.sg https://*.demdex.net/ https://cm.everesttech.net/ https://wogadobeanalytics.sc.omtrdc.net/;
script-src 'self' blob: https://*.wogaa.sg https://assets.adobedtm.com/;
img-src 'self' data: https://wogadobeanalytics.sc.omtrdc.net/ https://cm.everesttech.net/ https://dpm.demdex.net/;
connect-src 'self' https://*.wogaa.sg https://dpm.demdex.net/;
style-src 'self' 'unsafe-inline' https://assets.wogaa.sg/fonts/;
font-src 'self' data: https://assets.wogaa.sg/fonts/;
  • The Wrong Tracking Code was added

    Solution: To find out if you've implemented the Tracking Code properly in the correct environment, refer to instructions for the different environments.

Additionally, you can use your browser developer tools (e.g. Chrome DevTools) to troubleshoot, right-click the page and select Inspect to see if there is/are any errors in the developer console. It might be the case that you're using the production wogaa.js tracking code in your test environment(s) or vice versa, as such no data could be sent to the correct report suite.


Still unable to get your Tracking Code to work?

No worries, WOGAA Support can help! You can reach out to our support team through emailing wog.aa.support@ncs.com.sg. We will response to you as soon as possible.

For WOGAA Dashboard related queries, you can approach GovTech WOGAA team at wogaa@tech.gov.sg