Enhanced iFrame Support
- Auto recognize post page load HTML
- This gives our WEC script the ability to track events from forms, video, and link that are added to the web page bc javascript post load. Previously, these web events would go untracked.
- Communication with iframes hosted on different domains
- Example: A form is in an iFrame and hosted on Marketo.com and not the customer’s web domain. Now we can initialize the form and track the form fills inside these iFrames.
- Functions for web developers to fire our web events directly
- This gives the customer’s web developer the power to extend our base functionality and fire the web events on demand. Now they can custom implement our functionality under their strict security standards.
- More ROI data to push across the Terminus platform
- These are additional touchpoints and conversions we can now push into Ad Insights, Site Engagements, and more. Customers that use this functionality will see improved performance metrics from their website.
Below are functions and example of how you can programmatically, using javascript, pass in web event data to the Terminus tracking script. Examples of when these functions might be used would be passing a form fill to Terminus when a javascript enabled form is on a landing page, or passing web events from a parent page into an iFrame.
Function
Signatures
interfaceModifiableEventParams {
pageUrl?:string; // Must be a well-formed url
title?:string;
referrer?:string;
}
enumVideoEvent {
played='video_played',
ended='video_ended',
embeddedPlayed='embed_video_played',
embeddedEnded='embed_video_ended'}
trackPageViewEvent: (eventParams?:ModifiableEventParams)
trackFormSubmissionEvent: (emailAddress?:string, eventParams?:ModifiableEventParams)
trackLinkClickEvent: (linkLocation:string, eventParams?:ModifiableEventParams)
trackVideoEvent: (videoLocation:string, videoEvent:VideoEvent, eventParams?:ModifiableEventParams)
Examples
Page View Events
// Fire a default page view event
window.TerminusWEC.trackPageViewEvent();
// Fire a page view event with all custom properties
window.TerminusWEC.trackPageViewEvent({
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer'});
// Fire a page view event with a custom title only
window.TerminusWEC.trackPageViewEvent({
title:'Custom Title'});
Form Submission Events
// Fire a default form submission event
window.TerminusWEC.trackFormSubmissionEvent();
// Fire a form submission event with an email address and all custom properties
window.TerminusWEC.trackFormSubmissionEvent(
'human@email.com',
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a form submission event with an email address and a custom title only
window.TerminusWEC.trackFormSubmissionEvent(
'human@email.com',
{
title:'Custom Title' }
);
// Fire a form submission event with no email address and all custom properties
window.TerminusWEC.trackFormSubmissionEvent(
undefined,
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a form submission event with no email address and a custom title only
window.TerminusWEC.trackFormSubmissionEvent(
undefined,
{
title:'Custom Title' }
);
Link Click Events
// Fire a default link click event
window.TerminusWEC.trackPDFInteractionEvent('http://link-location.com');
// Fire a link click event with all custom properties
window.TerminusWEC.trackPDFInteractionEvent(
'http://link-location.com',
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a link click event with a custom title only
window.TerminusWEC.trackPDFInteractionEvent(
'http://link-location.com',
{
title:'Custom Title' }
);
Video Events
// Fire a default video played event
window.TerminusWEC.trackVideoEvent('https://www.youtube.com/watch?v=o-YBDTqX_ZU', 'video_played');
// Fire a video played event with all custom properties
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'video_played',
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a video played event with a custom title only
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'video_played',
{
title:'Custom Title' }
);
// Fire a default video ended event
window.TerminusWEC.trackVideoEvent('https://www.youtube.com/watch?v=o-YBDTqX_ZU', 'video_ended');
// Fire a video ended event with all custom properties
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'video_ended',
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a video ended event with a custom title only
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'video_ended',
{
title:'Custom Title' }
);
// Fire a default embedded video played event
window.TerminusWEC.trackVideoEvent(exampleVideo, 'embed_video_played');
// Fire a embedded video played event with all custom properties
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'embed_video_played',
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a embedded video played event with a custom title only
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'embed_video_played',
{
title:'Custom Title' }
);
// Fire a default embedded video ended event
window.TerminusWEC.trackVideoEvent(exampleVideo, 'embed_video_ended');
// Fire a embedded video ended event with all custom properties
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'embed_video_ended',
{
pageUrl:'http://somewhere.org/here',
title:'Custom Title',
referrer:'Custom Referrer' }
);
// Fire a embedded video ended event with a custom title only
window.TerminusWEC.trackVideoEvent(
'https://www.youtube.com/watch?v=o-YBDTqX_ZU',
'embed_video_ended',
{
title:'Custom Title' }
);
Comments
0 comments
Please sign in to leave a comment.