SiteWit JavaScript v3 Documentation



Similar documents
Login with Amazon. Getting Started Guide for Websites. Version 1.0

Tagging Guide: Website and Implementation. Contents

Drupal CMS for marketing sites

1: 2: : 3.1: 3.2: 4: 5: & CAPTCHA

MASTERTAG VALUE-ADDED SERVICES FOR ADVERTISERS SET-UP GUIDE

IBM Digital Analytics Implementation Guide

OpenGlobal WorldPay Recurring Payments (FuturePay) for VirtueMart

Social Application Guide

Login with Amazon. Developer Guide for Websites

Bazaarvoice for Magento Extension Implementation Guide v6.3.4

WEB DEVELOPMENT IA & IB (893 & 894)

CardSwipe Integration

1 open source' I community experience distilled. Piwik Web Analytics Essentials. Stephan A. Miller

Automating Security Testing. Mark Fallon Senior Release Manager Oracle

Usage Tracking for IBM InfoSphere Business Glossary

Integrating KIMBIA form widget data with Google Analytics. What's Inside? KIMBIA. What s required...

Tracking Campaigns with G-Lock Analytics

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

JMS MULTISITE for joomla!

Kentico CMS 7.0 E-commerce Guide

Working with Indicee Elements

ENABLING RPC OVER HTTPS CONNECTIONS TO M-FILES SERVER

Check list for web developers

Terms and Definitions for CMS Administrators, Architects, and Developers

Is Your Google Analytics Data Accurate?

Bazaarvoice for Magento

User Guide. Making EasyBlog Your Perfect Blogging Tool

MASTERTAG DEVELOPER GUIDE

Data Breaches and Web Servers: The Giant Sucking Sound

Web Development I & II*

GSPAY Merchant Manual

Elgg 1.8 Social Networking

Embedding tracking code into IAS

Additional information >>> HERE <<< Best Way to Get Website Traffic Real User Experience

FileMaker Server 15. Custom Web Publishing Guide

Synology SSO Server. Development Guide

How To Fix A Web Application Security Vulnerability

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

Getting Started With Parallels Business Automation 4.4

Lesson 7 - Website Administration

Ad Banner Manager 6.0 User Manual

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Advancements in Botnet Attacks and Malware Distribution

Setting cron job Linux/Unix operating systems using command-line interface

Guide to Web Hosting in CIS. Contents. Information for website administrators. ITEE IT Support

WEBSITE PRIVACY POLICY. Last modified 10/20/11

Login and Pay with Amazon Integration Guide

Klarna Magento module

Index. AdWords, 182 AJAX Cart, 129 Attribution, 174

Introduction to Ingeniux Forms Builder. 90 minute Course CMSFB-V6 P

Integrating Moodle with an external tool

Tenrox and Microsoft Dynamics CRM Integration Guide

Tracking an Affiliate Program or campaign

Presented by Martin Giffy D Souza Martin@ClariFit.com Blog: Web:

Tracking Code Migration Guide

Perl/CGI. CS 299 Web Programming and Design

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

Google Analytics Audit. Prepared For: Xxxxx

Setting up an Apache Server in Conjunction with the SAP Sybase OData Server

IBM Unica emessage Version 8 Release 6 February 13, User's Guide

Spectrum Technology Platform

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Checklist of Best Practices in Website

SHIPSTATION / MIVA MERCHANT SETUP GUIDE

Developing Microsoft SharePoint Server 2013 Advanced Solutions. Version: Demo. Page <<1/8>>

Programming IoT Gateways With macchina.io

Millennium Drive. Installation Guide

WEB ANALYTICS. Presented by Massimo Paolini MPThree Consulting Inc

Open Source Content Management System for content development: a comparative study

Web review of yoast.com

ClickDimensions Quick Start Guide For Microsoft Dynamics CRM /1/2011 ClickDimensions

AEC Version Installation/Upgrade Quick Start Guide

GENERAL ADMINISTRATION - SHOPPING CART

Module - Facebook PS Connect

Web Application Guidelines

Sample HP OO Web Application

EBOX Digital Content Management System (CMS) User Guide For Site Owners & Administrators

Connected Data. Connected Data requirements for SSO

The Social Accelerator Setup Guide

An Oracle White Paper June RESTful Web Services for the Oracle Database Cloud - Multitenant Edition

JobScheduler Web Services Executing JobScheduler commands

Apache JMeter. Emily H. Halili. Chapter No. 6 "Functional Testing"

Joomla Security Report

Scout Link: An Integration Overview

Itelpop Simple Screenpop Web Application Installation & Configuration Guide Version 1.0

CSCI110: Examination information.

Design and Implementation of Web Forward Proxy with

NTT Web Hosting Service [User Manual]

Overview. How It Works

Ruby on Rails Secure Coding Recommendations

FormAPI, AJAX and Node.js

depl Documentation Release depl contributors

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Transcription:

SiteWit JavaScript v3 Documentation Tracking code Basic tracking code The base SiteWit tracking code is sw.js on SiteWit s servers at analytics.sitewit.com/sw.js and should be embedded as follows (for support of http and https protocols). The function named swpreregister is optional, but is used to register goals, transactions and persona registration upon page load. The swpreregister function must appear before the async load of the main SiteWit script. // Page Load Goal Tracking, Transaction and Persona Settings var loc = (("https:" == document.location.protocol)? "https://analytics." : "http://analytics."); document.write(unescape("%3cscript src='" + loc + "sitewit.com/v3/[account_id]/sw.js' type='text/javascript'%3e%3c/script%3e")); Persona (Unique User) tracking code Persona tracking code is used to identify a user that has been logged into or registered with the system, this is placed on pages where identifying a specific user s behavior type. This is achieved by calling the set_goal function. sw.user.set_site_unique_id('[your Unique Identifier]'); //Other Transaction or Goal Settings sw.user.set_site_unique_id('[your Unique Identifier]'); Goal tracking code Goal tracking code is used to indicate that the user has achieved a goal, this is placed in special pages or on special actions that are considered meaningful to the client. This is achieved by calling the set_goal function. //Other Transaction or Persona Settings

Transaction Code Transactions have the ability to record extra information about an order such as order id, price and quantity. A transaction is added to a page hit by calling create_transaction. The create_transaction function returns an object that can then be used to add items. Transactions can be created with or without goals, but generally a transaction happens at the same time as a goal sw.create_transaction("[order_id]","[affiliate]","[subtotal]","[tax]","[city]","[sta te]","[country]"); trans.add_item("[sku]","[name]","[category]","[price]","[quantity]"); // Other Goal and Persona Settings sw.create_transaction("[order_id]","[affiliate]","[subtotal]","[tax]","[city]","[state]"," [country]"); trans.add_item("[sku]","[name]","[category]","[price]","[quantity]"); Callback or redirection code after page, transaction or goal hit In the event that you would like to execute javascript only after the script has recorded an analytics event (page hit, transaction, goal, etc.), you can pass a function to the register_page_view method that will be called after the data has been collected. This is useful for redirects where a cancel request may stop the data from being recorded or for chaining other analytics or goal requests. Redirecting after page load (this function must be higher on the page than the main script): sw.register_page_view(function(){location.href="[url]"); After an in page goal JavaScript Trigger: sw.register_page_view([discrete or anonymous function]);

Automated Implementation Strategies There are various ways to ensure that the analytics tracking pixel is installed on every page of your site. Besides placing the tracking code into each page or using one of our various plugins, you can also have it automatically injected into every page via your web server. Below are some easy methods of implementing the tracking pixel easily for universal coverage. Apache mod_substitute If you are running your site on Apache and have the mod_substitue module installed you can easily make sure the code is delivered on every page without having to worry about changes made to files in the future or ensuring that new files have the code embedded. Simply modify your htaccess file to include the tracking pixel code before the closing </body> tag in every response. AddOutputFilterByType SUBSTITUTE text/html Substitute "s </body> #your_tracking_script_here# </body> ni" IIS.NET Master Pages If you are using a.net site with support for Master Pages then it is best to include the pixel code before the closing </body> tag in the master page. In the case of nested master pages it is only needed in the top most master pages that other master pages are inheriting. MVC Layout The approach for MVC Layout pages is similar to the Master Page implementation above. It is best to include the pixel code before the closing </body> tag in the layout page(s). 3rd Party Hosting Plugins There are plugins available for implementing the SiteWit tracking pixel into your site. These plugins work with various platforms such as WordPress, Wix, and cpanel. Partner Integrations SiteWit also has deep partner integrations with some companies such as Yola which allows for an effortless integration

Functions _sw_analytics(); Is the main SiteWit Analytics object and is returned as the oject sw. var sw = new _sw_analytics(); _sw_analytics object set_goal(int goalid) Adds a goal id to a page hit, Goal ids are generated when a user creates a goal in the SiteWit application sw.set_goal(10); register_page_view(function callback) Commits the data recorded to the SiteWit servers for processing, this should be the last function called in tracking, anything added (transaction/goal) after this call will not get recorded. sw.register_page_view(oncomplete); sw.register_page_view(function(){location.href="[url]"); create_transaction(string orderid, string affiliation, string subtotal, string tax, string city, string state, string country) Creates and returns a transaction object. sw.create_transaction("1001","affiliate","30.00","7.00","tampa","fl", "us"); hit hit is a child object of _sw_analytics (_sw_hit_info) that can be used to override the domain and page values recorded automatically by the _sw_analytics object hit.set_page(string url) Overrides the url automatically recorded by the _sw_analytics object initialization with the value passed to it. sw.hit.set_page("mypage.html");

hit.set_domain(string url) Overrides the domain automatically recorded by the _sw_analytics object initialization with the value passed to it. sw.hit.set_domain("www.sitewit.com"); user user is a child object of _sw_analytics (_sw_user_info) that can be used to set the site unique identifier. user.set_site_unique_id(string id) A unique identifier is a way for sites to uniquely identify users based on what they know about a user such as the email address of a logged in user. The unique identifier can be any string. sw.user.set_site_unique_id("user@email.com"); _sw_transaction Calling create_transaction() in the main _sw_analytics object creates and returns a _sw_transaction object. You can then add items to the new transaction object. add_item(string sku, string name, string category, string price, string quantity) Adds an item to the transaction sw.create_transaction("1001","affiliate","10.00","0.70","tampa","fl", "us"); trans.add_item("001","item1","category","1.00","10");