Method Calls

trackEvent

trackevent method // initialize the monetateq object if the monetateq object is // already present on the page, you don't have to do this again window\ monetateq = window\ monetateq || \[]; // send the event key when the event occurs // "event key" is the name of the key that you want to send window\ monetateq push(\["trackevent", \["event key"]]); the trackevent method and api events that you create in event builder provide a way to indicate that something important has happened on your site this method can be called multiple times per page however, monetate only collects data once per event per page for example, you can track when a customer's mouse pointer hovers over a navigation item by reporting a nav hover event each time this occurs nevertheless, the monetate platform only tracks the first instance on each page monetate inspector view the monetate inspector browser plug in doesn't show custom events that you push with the trackevent method unless you first create an api event in event builder see build api events in the monetate knowledge base for the steps to create this type of event the events panel of monetate inspector, with a trackapi event in the 'page event' row code sample once you create the api event in event builder with the appropriate event key , the code snippet below explains how to trigger the event an event key is a string composed of alphanumeric characters (a–z, 0–9) and select special characters (spaces, underscores, and hyphens) ensure that you give an event key a descriptive name so that you can easily understand what it references in the code you can make these calls from anywhere in your site's code to signify when a custom event has occurred this code sample shows a typical call to track an event it contains the method in use that results in the monetate inspector results shown in the previous screenshot trackevent example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "trackevent", \["reached platinum"] ]);