-
Notifications
You must be signed in to change notification settings - Fork 56
DAP Custom Event Tracking
Event tracking is not controlled with a parameter, but rather with a function called gas4()
All custom events must have this structure:
gas4('event','parameter');
Here is the breakdown of these values:
- event: Required, must not be changed.
Specifies that this is an event. Example: 'form_start'
- parameter: Required, should be customized.
Must be a object with key value pair. Example: 'form_name' : 'newsletter'
Below are the currently predefined events. Select the event below to review its implementation instructions.
- Virtual Pageview
- Download Button Click
- Form Start
- Form Progress
- Form Submit
- Content View
- Social Share
- Social Click
- Image Click
- Call To Action Click
- Navigation Click
- Was This Page Helpful Submit
- FAQ Click
- Accordion Click
- Error
- Search Filter
- Search - Sort
If you would like to track only when a user performed a specific event which does not belong to the list of predefined events above. Use our dap_event
event. Review our Custom Event section below for its implementation instructions
A “virtual” pageview is when you send a pageview hit to Google Analytics, even though a full page load has not actually occurred. This is common to do in scenarios where new content is presented to the user without a new page being requested and rendered by the browser. Virtual pageview tracking is not controlled with a parameter, but rather with a function called gas4(). Add the function below to track virtual page view
Code Snippet:
gas4('page_view',`
{
'page_location':'<page_location>',
'page_title':'<page_title>'}
);
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Code Snippet Example:
<a href="#" onclick="gas4('page_view',{'page_location':'/cart/step1.html','page_title':'Cart - Step 1'});"><img src="nextbutton.png"></a>
Add the function below to track when a user downloads a file using Download Button.
Code Snippet:
gas4('file_download',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'file_name':'<file_name>',
'file_extension':'<file_extension>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track the first time a user interacts with a form
Code Snippet:
gas4('form_start',
{
'form_name':'<form_name>',
'form_id':'<form_id>',
'form_destination':'<form_destination>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user interacts with a form (recommended for multi step form)
Code Snippet:
gas4('form_progress',
{
'form_name':'<form_name>',
'form_step':'<form_step>',
'form_id':'<form_id>',
'form_destination':'<form_destination>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when the user submits a form
Code Snippet:
gas4('form_submit',
{
'form_name':'<form_name>',
'form_step':'<form_step>',
'form_id':'<form_id>',
'form_destination':'<form_destination>',
'form_submit_text':'<form_submit_text>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user view an important content
Code Snippet:
gas4('content_view',
{
'content_id':'<content_id>',
'content_type':'<content_type>',
'content_name':'<content_name>',
'section':'<section>'`
});
Note: Javasc 8000 ript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user shares content on social profile
Code Snippet:
gas4('social_share',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'link_classes':'<link_classes>',
'social_network':'<social_network>',
'content_type':'<content_type>',
'section':'<section>',
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user clicks content on social profile
Code Snippet:
gas4('social_click',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'link_classes':'<link_classes>',
'social_network':'<social_network>',
'content_type':'<content_type>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user clicks on a image
Code Snippet:
gas4('image_click',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'link_classes':'<link_classes>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user clicks on a call to action
Code Snippet:
gas4('cta_click',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'link_classes':'<link_classes>',
'outbound':'<outbound>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user click on a navigation menu
Code Snippet:
gas4('navigation_click',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'link_classes':'<link_classes>',
'outbound':'<outbound>',
'section':'<section>',
'menu_type':'<menu_type>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user submit the form Was this page helpful
Code Snippet:
gas4('was_this_helpful_submit',
{
'choice':'<choice>',
'reason':'<reason>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user expands/collapse a Frequently Asked Question in a page
Code Snippet:
gas4('faq_click',
{
'selection':'<selection>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user click on the Accordion
Code Snippet:
gas4('accordion _click',
{
'selection':'<selection>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:
Add the function below to track when an error thrown for a specific action performed by the user
Code Snippet:
gas4('error',
{
'error_message':'<error_message>',
'section':'<section>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:
Add the function below to track when a user selects sort option for a search term on the page
Code Snippet:
gas4('filter',
{
'selection':'<selection>',
'search_term':'<search_term>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track when a user selects a filter for a search term on the page
Code Snippet:
gas4('sort',
{
'selection':'<selection>',
'search_term':'<search_term>'
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

Add the function below to track only when a user performed a specific event which does not belong to the list of predefined events above.
Code Snippet:
gas4('dap_event',
{
'link_text':'<link_text>',
'link_domain':'<link_domain>',
'link_url':'<link_url>',
'link_id':'<link_id>',
'link_classes':'<link_classes>',
});
Note: Javascript properties that are in red in the image are code examples and should be replaced by DAP users with their respective values.

Reporting Configuration Example:

