1. UNICA NETINSIGHT
JAVASCRIPT TAGGING
SUPPLIER CONNECTION
WEB ANALYTICS
TAGGING TRAINING
Kikiy Weathers, Web Analyst/Web Effectiveness Lead
July 3, 2012
3. UNICA NETINSIGHT
JAVASCRIPT TAGGING
Types of Tagging:
Basic Tagging
Raw data sent to Unica NetInsight each time the page loads in a visitor’s
browser. Javascript tag is automatically included on all IBM.com
pages.
Custom Tagging
Event tags include interactions visitors have with a tagged page; for
example, video or social bookmarking. Custom tags are not included
automatically included on IBM.com pages. This must be requested.
4. UNICA NETINSIGHT
JAVASCRIPT TAGGING
DIRECT TAGS
Special tags, called Web Beacons, are available for
data that does not use Javascript. For example, web
apps and/or Flash applications require this special
tagging.
5. UNICA NETINSIGHT
JAVASCRIPT TAGGING
How Tagging Works
1 Place tag on each page (usually in footer)
<div id="ibm-metrics">
2 <script src="js/stats.js" type="text/javascript">//</script>
</div>
3 A page tag image (1X1 pixel) is included in
the script
4 Visitor information is transferred to Unica
(1) When tagged page is loaded in browser
5 OR (2) when user interacts with a page
tagged with events (custom tagging)
6. UNICA NETINSIGHT
JAVASCRIPT TAGGING
BASIC PAGE TAGGING
Data Dimensions Metrics
•IP address •Page •Number of visitors
•GMT date/time •Entry Page •Number of views
•Page request with query string •Exit Page •Number of visits
•Referring URL •Entry Referrer •Number of new visitors
•Screen resolution •Browser •Number of repeat visitors
•Screen color depth •Platform •Total time online
•Browser language •Geographic Data •Average viewing time
•Browser Java support (Country, City, Time •Average visit duration
•User agent Zone, Organization, •Views per visit
•Cookie information etc.)
•Date
•Time
•Day of the Week
7. UNICA NETINSIGHT
JAVASCRIPT TAGGING
What Happens When JavaScript is Disabled?
• JavaScript is a client-side scripting language, which means it is executed
by the visitor’s browser and NOT on a server.
•The code is sent to the web browser and executed there.
• When JavaScript is disabled by the visitor, you can write an HTML
<noscript>tag to pass the information (See Page 6 of the
Unica NetInsight’s Tagging document for more detailed information on how
to write this code).
FYI: Robots and Spiders CANNOT execute JavaScript; therefore,
traffic with JavaScript enabled is human-based traffic.
8. UNICA NETINSIGHT
JAVASCRIPT TAGGING
REQUIRED JAVASCRIPT VARIABLES
There are Four (4) Required Variables
Required page tagging variables are defined in the page tag script (ntpagetag.js).
1 NTPT_IMGSRC
A string variable that contains the URL of the page tag image. The
URL must point to the Unica OnDemand server and is provided by your
Unica Technical Account Manager.
2 NTPT_SET_SESSION_COOKIE
Checks for the session cookie and sets it if it does not exist. The
default session cookie name is NetInsightSessionID. You can specify a
different cookie name using the NTPT_SESSION_COOKIE_NAME
variable.
9. UNICA NETINSIGHT
JAVASCRIPT TAGGING
REQUIRED JAVASCRIPT VARIABLES
- Continued -
3 NTPT_FIELDS
A string variable that contains the URL of the page tag image. The URL
must point to the Unica OnDemand server and is provided by your Unica
Technical Account Manager.
4 NTPT_MAXTAGWAIT
The maximum number of seconds that a call to ntptLinkTag() or
ntptSubmitTag() will wait before following the link or submitting the form.
The delay is intended to ensure that the page tag request is sent before the
tagged page is unloaded.
10. UNICA NETINSIGHT
JAVASCRIPT TAGGING
De-Bugging JavaScript
(1) FireBug – FireFox
Tools> Web Developer
(You may have to go to add-ons first and load it into FF)
(2) HTTP FOX - FireFox
Tools> Web Developer
(You may have to go to add-ons first and load it into FF)
(3) TamperData:
http://tamperdata.mozdev.org/help.html OR
FireFox Add-Ons
11. UNICA NETINSIGHT
JAVASCRIPT TAGGING
VISITOR COOKIES
By default, the NetInsight OnDemand page tag script assigns a cookie to visitors.
NetInsight OnDemand uses this cookie for visitor identification and parameter
analysis. The visitor identification cookie is set when the page tagging script loads.
Because the cookie is set through JavaScript, visitors must have JavaScript
enabled in their browser in order to be tracked. (Users who do not have JavaScript
enabled appear in the unique visitor count but no page tag data is collected for
them.) [SEE TABLE ON SLIDE 6 FOR WHAT IS NOT CAPTURED IF JS IS
DISABLED
The visitor identification cookie can be changed to do the following:
• Stop setting visitor identification cookies
• Change the visitor identification cookie name (as a best practice, do not change
this cookie name if you are already collecting data)Change the expiration period
for the visitor identification cookie
• Declare a domain visitor identification cookie to track visitors across subdomains
12. UNICA NETINSIGHT
JAVASCRIPT TAGGING
EVENT TAGGING
DEFINITION OF AN EVENT:
An event is any on-page action other than loading a page on your site. Events
include but are not limited to the following:
• Changing a field on a form
• Selecting an option in a drop-down list box
• Submitting a form
• Clicking a link to display a page on another site
• Starting a video
• Viewing a PDF document
• Checking an option (such as sound on/off)
• Events are plentiful in RIAs such as Flash or AJAX applications.
• The Unica page tag script includes special functions to use when tagging events.
13. UNICA NETINSIGHT
JAVASCRIPT TAGGING
THINGS YOU SHOULD KNOW ABOUT EVENTS:
Unlike a basic page tag, which sends a request when a page loads, an event tag
sends a request when an event occurs on a page.
Another difference is that a basic page tag calls the entire page tagging script and
an event tag calls a specific function in the script. There are three main event
tagging functions:
(1) ntptEventTag
(2) ntptLinkTag
(3) ntptSubmitTag
Every event you want to track must call one of these functions in its JavaScript
event handler or Flash ActionScript.
Counting events as events and not page views
NetInsight OnDemand considers every call to the page tagging script a page view, even
if the call is to one of the event tagging functions. To cause an event to count as an event
and not a page view, set the field-value pair ev=eventtype using the query modifier of the
ntptEventTag, ntptLinkTag, or ntptSubmitTag function.
Notes de l'éditeur
THE <NOSCRIPT> TAG IS USED TO PROVIDE AN LATERNATE CONTENT FOR USERS THAT HAVE THEIR BROWERS OR HAVE BROWSER THAT DOESN’T SUPPORT CLIENT-SIDE SCRIPTING, SUCH AS JAVASCRIPT. IT’S ONLY SUPPORT IF SCRIPTS ARE NOT DISPLAYED.
PLEASE SEE THE CHAPTER 9 OF TAGGING DOCUMENT (PAGE 39) FOR THE SPECIFIC SYNTAX RELATED TO THE REQUIRED VARIABLES.
PLEASE SEE THE CHAPTER 9 OF TAGGING DOCUMENT (PAGE 39) FOR THE SPECIFIC SYNTAX RELATED TO THE REQUIRED VARIABLES.
You can edit the page tag script (ntpagetag.js) to add parameters to the script element that sets variables for the imodTag.js script that make the following
NetInsight OnDemand analyzes events that occur on tagged pages only. A visitor must have at least one tagged page view in the visit before NetInsight OnDemand tracks events for that visitor. A tagged event is tracked only if the previous page view for the visitor matches the page on which the event occurred. (If you are using direct tags, the lc parameter for the event must match the lc parameter for the previous page view.)