viewMainPage

awoo Pixel Event for main page loaded. 🏠

✨ Introduction

The viewMainPage event is designed to trace when a user engages with the focal point of your digital presence—the main page. This event discreetly notes each visit to your website's main page as users navigate through your website. The accumulating count of viewMainPage may serve as a reference for the effectiveness of your central hub.


⭐ JS Snippet of viewMainPage

Below is the JavaScript snippet for the viewMainPage event. To correctly trace a user's engagement with the main page, you should embed it only into the main page without any modification.

<script type="text/javascript">
  awpx('event', 'viewMainPage');
</script>

🌟 Triggering Condition

The viewMainPage event should be triggered only when the main page is loaded.

Beware that awoo Pixel's initialization should be executed before viewMainPage is triggered. Hence, you may need to add a "defer" attribute to those two scripts to have them executed in the order they appear in the webpage's HTML. Placing viewMainPage snippet just before the closing </body> tag helps preserve the execution order of the scripts as well. Check the following code block for sample implementations:

<script type="text/javascript" defer>
  // awoo Pixel's initialization
</script>

<script type="text/javascript" defer>
  awpx('event', 'viewMainPage');
</script>
<html>
  <body>
    
<!-- Your HTML content goes here -->

    <script type="text/javascript">
      awpx('event', 'viewMainPage');
    </script>
  </body>
</html>
❗️

There should be only one awoo Pixel's initialization

Multiple awoo Pixel's initialization on a single webpage will cause error, so make sure you only have it loaded once per page.


🌠 Implement with GTM

For your better comprehension, below are the sample screenshots from GTM (Google Tag Manager) for the implementation of viewMainPage event. The JavaScript snippet is inserted as a custom HTML tag, with the triggering condition set to Page View - Page Path equals '/'. You may need to modify the actual implementation based on your website. Beware that awoo Pixel's initialization should be loaded before any triggered event.

insert viewMainPage event as a custom HTML on GTM

insert viewMainPage event as a custom HTML on GTM

suggested triggering condition for viewMainPage event on GTM

suggested triggering condition for viewMainPage event on GTM


Edited by: Justin Sung