Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including xiti-smarttag-plugin with all npm packages installed. Try it out:

var xitiSmarttagPlugin = require("xiti-smarttag-plugin")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

xiti-smarttag-plugin v1.1.5

Xiti smarttag vanilla js implementation

Xiti Smarttags plugin

UMD Library wrapper for xiti's smarttag javascript library

Getting started

Install

   npm i xiti-smarttag-plugin
   yarn add xiti-smarttag-plugin 

or inline script

   <script src="https://unpkg.com/xiti-smarttag-plugin@1.0.0/lib/SmarttagPlugin.js"></script>

Usage

In es6 project


   import SmarttagPlugin from 'xiti-smarttag-plugin';
   const tag = new SmarttagPlugin('XXXXXX'/*at internet site id*/); 
   

or when it's loaded inline script

  <html>
  <head>
    <title>testing tags</title>
    <script src="https://unpkg.com/xiti-smarttag-plugin@1.0.0/lib/SmarttagPlugin.js"></script>
  </head>
  <body>
  <h1>title</h1>
  <script>
    var tag = new window.SmarttagPlugin('XXXXXX');
  </script>
  </body>
  </html>

Click hit

   tag.sendClick({elem: this,
                  name: 'clickName',
                  level2: 'clickLvl2',
                  type: 'navigation',
                  event: event
   }); //this is the xiti object

Page hit

   tag.sendPage({name:'pageName',
                 chapter1:'chap1',
                 chapter2:'chap2',
                 chapter3:'chap3'
   }); //this is the xiti object
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free