A web tracking event allows you to specify the type of web behaviors that you want to be tracked and reported which gives you a detailed look into a contact's behavior. You can add most event types to external pages by copying and pasting the event-specific handler to the proper section of the page's source code. Landing pages automatically add most events.
Example
<form name="myform" action="actionpage.html" onSubmit =" return ewt.trackFormSubmit({name:'Contact Us Form Submit',type:'forms'});'>
In the above sample code, type is tied to the custom web tracking event, and the name is the Contact Us Form Submit.
Confirm web tracking
Confirm that a branded domain site is set up correctly for web tracking.
Implement events on an external web page
You need to configure events on your web pages using either simple inline JavaScript, JavaScript tags, or HTML meta tags. Some JavaScript and HTML knowledge is helpful. In most cases, you may copy the event-specific example from this documentation, and then paste it into your page's source code.
Example event code
In this example, when a visitor clicks a link, web tracking will report it back to the web tracking table. Reporting will identify the visitor who has clicked the link "Whitepaper."
<a href='http://www.goacoustic.com/search.jsp" rel="freeklink" title="http://www.goacoustic.com/search.jsp" />' target="_blank" onClick ='return ewt.track({name:Whitepaper,type:'click',link:this });'>White Paper 1</a>
Event code explained
name: A friendly name of the event, that can be used in query criteria and in scoring models.
type: A type of event to be tracked. Other types include form, download, multimedia, and user-defined custom event type.
return ewt.trackLink: This tells the web cookie to record the click and send the data to the web tracking table.
Examples of event types
Event Types: Refers to a type of tracked web interaction behavior.
- Standard Type - Supported in external websites and landing pages
- Multimedia: A link type of multimedia is clicked.
- Click (Through a page): A click occurs on a tracked link within a page.
- Download: The download link type is clicked, containing the name of the download.
- Form Submit: A form is submitted as the result of a "Submit" button-type click.
- Share to Social: A link type of share to social is clicked.
- Site Visit: This event is raised automatically when a page view occurs on the first page in a visit/session.
- Custom Type - Supported in external sites only
- Custom Events (Only in Web Tracked External Domains): An interaction that triggers an event type of: "Custom", defined in the Settings > Administration > Organization Settings > Web Tracking Settings.
- Custom Event Type - Friendly Name: Defined by the event implementer and passed as an identifier for the context in which the event was triggered.
Click event
The click event type identifies clicks on a tracked hyperlink inserted into your web page.
Click event type can be used in scoring for behavioral scoring and in contact insight actions for clicked a hyperlink event.
For external sites, you can add an onClick event handler.
<a href="https://acoustic.com/solutions/marketing-automation/" target="_blank" onClick="return ewt.trackLink({name:'Solutions - Marketing Automation',type:'click',link:this});">Marketing Automation</a>
In Campaign landing pages, any tracked link in your landing page site automatically captures this event.
Conversion tracking event
To track a conversion event, you'll need to configure the conversion tracking (COT) code on the confirmation page of your shopping cart, sign-up form, or any kind of 'Success' page.
How does the conversion tracking code work?
The conversion tracking (COT) code enables the pass-through of parameters from the landing page to the conversion page, allowing you to get metrics for page opens or link clicks, so you can create conversion reports for your website.
Note: This function is available for external web-tracking domains only.
Example (Using a Link)
<a href='thankyou.jsp' target='_self' onclick='return ewt.cot({action:'SomeItem',detail:'Product',amount:'1.00'});'>Confirm Purchase</a>
Example (Using a JavaScript call)
<script>
ewt.cot({action:'Purchase',detail:'Blueberry Ice Cream',amount:'1.24'});
</script>
On a confirmation page
<script>
window.addEventListener('load', function(){
ewt.cot({action:"Purchase",detail:"Blueberry Ice Cream",amount:"1.24"});
});
</script>
With an action click
<script>
function multiconv(){
ewt.cot({action:"Purchase",detail:"Blueberry Ice Cream",amount:"1.24"});
ewt.cot({action:"Purchase",detail:"Vanilla Ice Cream",amount:"1.28"});
ewt.cot({action:"Purchase",detail:"Chocolate Ice Cream",amount:"1.29"});
}
</script>
...
<button type="button" onclick="multiconv">Submit</button>
Example using an onLoad event attached a 1x1 pixel image
In this example, a simple 1x1 pixel image is loaded on the confirmation page of the purchase, and the onLoad event is called in the loading of this image.
<img src='confirmation.png'
onload="ewt.cot({action:'purchase',detail:'galaxy_tab',amount:'300.00'})" width=0 height=0
/>
Examples using link targets
The following codes work with these target attributes:
_self (clicking a hyperlink that points to the same page)
Example
<a href='' target='_SELF' onClick='javascript:return ewt.cotLink({action:'Purchase',detail:'Laptop',amount:'499.00',link:this});'>self to another website cotLink </a>
_blank (clicking a hyperlink that points to a new window)
Example
<a href='' target='_blank' onClick='javascript:return ewt.cotLink({action:'Purchase',detail:'Laptop',amount:'499.00',link:this});'>self to another website cotLink </a>
_parent (clicking a hyperlink that targets a parent container from an iframe)
Example
<a href='' target='_top' onClick='javascript:return ewt.cotLink({action:'Purchase',detail:'Laptop',amount:'499.00',link:this});'>self to another website cotLink </a>
_top (clicking a hyperlink that targets a frame)
Example
<a href='' target='_parent' onClick='javascript:return ewt.cotLink({action:'Purchase',detail:'Laptop',amount:'499.00',link:this});'>self to another website cotLink </a>
Custom event type
Custom Events can be called using Javascript events. For example, it can be used for onLoad, onClick, onSubmit, and so on.
Use the custom event type
- On external websites
- In scoring for behavioral scoring
- As entry criteria for a program
- In contact insight actions for '%%Custom Event Name%%' event
- As decision diamond criteria within a program
Implement a custom event type
- Log in as an organization administrator and go to Organization Settings > Web Tracking Settings.
- In Custom Web Tracking Events, click Add.
- Enter your Custom Event name.
- Click Save.
Note: Reserved event types (click, download, form, multimedia) cannot be added to custom events and will result in the following error: There is already a web tracking event with that name. Please rename and save again.
What to do next
You can configure web tracking to call a custom event using an onLoad event. To call a custom event when a web page is loaded on an external site, add the following script to your page:
<script type='text/javascript'>
var customEventsOnLoad = window.onload;
window.onload = function()
{ customEventsOnLoad();
ewt.track({name:'page',type:'pagetype'});
ewt.track({name:'chapter',type:'pagetype'});
}
</script>
Note: Currently there is no way to delete an existing custom web tracking event because there is an associated risk. But the custom event can be renamed to a different name so that the user can identify it as an abandoned event. If you would like your custom web tracking event to be renamed, please log a support case.
Download event
Download event type identifies a click event on a download link type (link to file) by your visitor.
Use the download event type
- In scoring for behavioral scoring.
- As entry criteria for a program.
- As a decision diamond criteria within a program.
- As criteria within a query.
- In contact insight actions for a file download event.
For an external site, add an onClick event handler.
Example
<a href='http://www.goacoustic.com/whitepaper1.pdf' onClick ='return ewt.trackLink({name:'Whitepaper 1',type:'download',link:this });'>Acoustic White Paper 1</a>
In Campaign landing pages, the download event is raised when a download link type (link to file) is inserted into your landing page.
Multimedia event
Multimedia event type identifies a click on a media link type inserted in your landing page or through a custom script on a link for an external domain.
Use the multimedia event type
- In scoring for behavioral scoring
- In contact insight actions for a 'played media' event
On an external site, you can add a JavaScript event to a media player on your website. The function needs to be called from the player state play() function.
<script type='text/javascript'>
var
ewt.track({name:'played video',type:'multimedia'});
</script>
For a meta-tag implementation, you can use: <meta name='com.goacoustic.pagename' content='Home Page' />
As a passed URL variable, you can use http://www.goacoustic.com/index.html?vpagename=Home%20Page
In Campaign landing pages multimedia plays are not tracked in internal landing pages and websites. However, page views are tracked.
Page view event
Page view event type is used for the following and identifies each page visit for a visitor in a session per site visited.
- As a scored behavior within a scoring model
- As entry criteria to a program
- As a decision diamond criteria within a program
- As criteria within a query
- In contact insight for the site visit history visit path
The page view event type is implemented as follows
The page name may be passed with the page view event using one of the following methods below. By default, this will be the URL of the visited page, without the query string. The page view is automatically logged on pages that have the web tracking script.
Campaign looks for the codes in the order listed below (Options 1-3); once found, it ignores the other codes.
Note: If your page titles are optimized using descriptive names, we recommend using the meta-tag or JavaScript call.
Option 1: As a passed URL variable
http://www.goacoustic.com/index.html?vpagename=Home%20Page
Option 2: External site - Add the JavaScript page name description to each web page
<script type='text/javascript'>
var ewt_pagename = 'Page Name';
</script>
Option 3: Meta-tag implementation
<meta name='com.goacoustic.pagename' content='Home Page' />
In Campaign landing pages, any page in your landing pages site automatically captures a page view event when the first page loads, for each first unique visit to a site.
Site view event
The site view event type identifies a unique visit to your external domain or landing page site within a visitor's session.
Site view event type is used as follows:
- As a scored behavior within a scoring model.
- As entry criteria to enter a program.
- As a decision diamond criteria within a program.
- As criteria within a query.
- In contact insight for the site visit history visit path.
Site view event type is automatically created on external web pages and Campaign landing pages when a page loads. The event is triggered by default, once per site, per session. This can even occur across multiple sites visited in an active session.
Troubleshooting
An error is triggered when there is a space or an invalid character in the web tracking event name. To prevent this error, avoid spaces and special characters (!@#$%^&).