Skip to content

Transactional Service Implementation

By implementing WOGAA tracking code, you'll be able to monitor how many of your TS transactions were started and how many of which were completed.

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.


Prerequisite

  • Have you implemented WOGAA Tracking code for your Informational Service (IS) before setting up your transactional service (TS)?

  • IS and TS have parent and child relationship, whereby a TS must belongs under a IS.


Step 1. Register your Transactional Service

System/Business owner should register your TS under Manage Service first.

If you're an external vendor assisting in the technical implementation: once you've received the tracking code, you may proceed to Step 3.

Step 2. Get Your Tracking ID

  1. Login to wogaa.sg
  2. View your respective transactional service under transactional services tab in "Manage Services"
  3. You will see the respective tracking ID in your transactional service details page as shown below

Screenshot 2019-05-31 at 1 31 39 PM

Step 3. Implement of Event Code

Please ensure you have the tracking ID for the services you wish to implement event tracking code for.

There are 2 event trigger codes for you to use.

Note to replace the <tracking_id> with the tracking ID you gotten from step 2.

  1. Event trigger code to start tracking the transactional services
window.wogaaCustom.startTransactionalService('<tracking_id>')
  1. Event trigger code to end tracking the transactional services
window.wogaaCustom.completeTransactionalService('<tracking_id>')
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 (www.example.gov.sg)

Name of Transactional service Tracking ID
Creation of user example-1
Apply for approval example-2

Step 4. Verify your TS implementation

Verify transactional service

Did you managed to set up the production environment successfully? You may check out our Troubleshooting Guide if you have any further queries.

Note: Test Environment Set up

Informational Service and Transactional Service have a parent and child relationship. If you've registered your Test URL under IS Test Environment, it will be reflected under TS Test Environment as well. With that, you'll be able to use back the TrackingID from step 2 for your test environment with no additional action required.

Reference: Registering IS and TS Test Site


Examples

The code snippets below are just some example on how to call startTransactionalService() and completeTransactionalService() functions by using your assigned Tracking Id. You don't necessarily have to follow the example below.

Onload-Event - Invoking startTransactionalService() and completeTransactionalService()

    <html>
    <head>
    ...
    <script src="https://assets.wogaa.sg/scripts/wogaa.js"></script>
    </head>
    ...
    <script type="text/javascript">
        window.wogaaCustom.startTransactionalService('<trackingId>');
        window.wogaaCustom.completeTransactionalService('<trackingId>');
    </script>
    </html>

On-click Event - Invoking startTransactionalService() and completeTransactionalService()

    <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 completeTransactionalService()

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.


Optional: Implement Custom TransactionId

Info

In the default transactional services tracking implementation, WOGAA will assign a unique transactionId upon a valid start event trigger. If your service uniquely identify your transactions and would want WOGAA to utilise the ids you generate, the following method might be suitable for you.

Implement Event Code with Custom TransactionId

Follow Steps 1-2 in the guide above.

Note to replace the <tracking_id> with the tracking ID you gotten from step 2 as well as <transaction_id> with the id you will like WOGAA to use to identify this transaction.

  1. Event trigger code to start tracking the transactional services
window.wogaaCustom.startTransactionalService('<tracking_id>',{uniqueTransactionId:'<transaction_id>'})
  1. Event trigger code to end tracking the transactional services
window.wogaaCustom.completeTransactionalService('<tracking_id>',{uniqueTransactionId:'<transaction_id>'})

When to use Custom TransactionId

  • You have a systematic way of identifying transactions and is able to pass these identifiers to WOGAA
  • You have a save as draft state where users are able to switch between different drafts of the same transactional service within the same session.

Next: Enable Sentiment on your site