Implement and Verify Code¶
This document is a guide to implement and verify WOGAA event trigger codes on your site.
Do not reshare this document with anyone unless they need to implement WOGAA tracking on their websites.
This guide will take you through the steps to implement and verify event trigger code for Transactional Service in different environments.
For implementation of code in Test and Production environment,
Please ensure that you have done the following before you proceed
- Successfully implemented wogaa.js v2 code for Informational Service ( Implementation and Verify Guide for Informational Service )
- Collate Transactional Service's tracking ID ( How to get your tracking ID )
- Also, see the information on where to place the event trigger codes based on the types of Transactional Service design structure.
For code implementation of multiple transactional services, we recommend you to collate all the unique tracking ID for each service required.
Implement and Verify Event Code¶
Please ensure you have the tracking ID for the services you wish to implement event tracking code for. ( How to get your tracking ID )
There are 2 event trigger codes for you to use
Event trigger code to start tracking the transactional services
Event trigger code to end tracking the transactional services
The correct tracking ID should be passed to
If the tracking ID passed to either of the event trigger code doesn't belong to your website, event trigger code will not work.
Transactional service belonging to Example Website (
|Name of Transactional service||Tracking ID|
|Creation of user|| |
|Apply for approval|| |
When should I invoke
window.wogaaCustom.startTransactionalService('example-1') should be invoked when the website user starts the transactional service
Creation of user
window.wogaaCustom.completeTransactionalService('example-1') should be invoked when the website user completes the transactional service
Creation of user
What argument should I pass to
window.wogaaCustom.startTransactionalService('example-1')will work since the Example Webite
www.example.gov.sghas tracking ID
example-1tagged under it.
window.wogaaCustom.startTransactionalService('testing-1')will not work since the Example Webite
www.example.gov.sgdoesn't have tracking ID
testing-1tagged under it.
Verify if your site is sending both events¶
We will need the Chrome extension Snowplow Chrome Extension to verify the base code
- Install Snowplow Chrome Extension
- On Chrome, navigate to the website with the base code installed.
- Right-click on the page and click Inspect
- Inside the Inspect console, click on the Snowplow Tab,
Refresh the page where the base code is installed and see that
Structured Event: transactionalServiceevent is populated.
Select on one of the
Structured Event: transactionalServiceevents as shown below:
- Event action is either
- Collector address for staging is
- Collector address for production is
completeevent could be in different locations on your site. In this case, you may only see one event at a time. Navigate to the page where you installed code, and verify both events are triggered in their respective page.
- Event action is either
Verify if Wogaa server is receiving both events¶
The verification of Transactional Service on the server side is done automatically, however to be considered as verified, both
completeTransactionalService events must be captured by our backend server.
It may take up to 24 hours for the verification. Once verified, we send out an email notification to Officer In Charge (OIC) for the Transactional Service. Please let us know if there is any issues with regards to this via email@example.com
Self service verification tool (staging only)¶
This tool allows you to verify if your implementation is working correctly in your test or staging environment by showing the past 7 days' transaction count. Please note it will not query the events from production server.
Please check if your test or staging setup is using the following script
Then use this tool to check your transactional service events by either providing the
domain of your test server or staging server, or providing the
tracking_id of your transactional service. Please omit
https:// when providing the
How to Get Your Tracking ID¶
- Login to wogaa.sg
- View your respective transactional service under transactional services tab in "Manage Services"
- You will see the respective tracking ID in your transactional service details page as shown below
The code snippets below are just some example on how to call
completeTransactionalService() functions by using your assigned Tracking Id. You don't necessarily have to follow the example below.
Onload-Event - Invoking
On-click Event - Invoking
<html> <head> ... <script src="https://assets.wogaa.sg/scripts/wogaa.js"></script> </head> ... <!-- On-click event to start the transaction --> <button onclick="window.wogaaCustom.startTransactionalService('<trackingId>')">Start Transaction</button> ... <!-- On-click event to complete the transaction --> <button onclick="window.wogaaCustom.completeTransactionalService('<trackingId>')">Submit Transaction</button> </html>
In addition, some of the Transactional Service's designs of the system can have different ways at which the user starts and/or completes the transaction. For example:
- Invoking onclick event for
startTransactionalService()and onload event for
If you have a button to indicate the start of the transaction, then you can put the
startTransactionalService() on the onclick Event. For the complete transaction, if the user completes the transaction with a confirmation or "thank you" message page, then you need to add the
completeTransactionalService on the onload Event at the page.
FAQs for TS Tracking Code Implementation & Verification¶
startTransactionalService() is called, but why do I not see any Snowplow events fired?¶
Assuming you have implemented and verified the Event trigger codes correctly, the
startTransactionalService() will only send events on the first call in a session. This is to prevent multiple counts of start if user keeps refreshing the page.