1.1.5 • Published 6 years ago

xiti-smarttag-plugin v1.1.5

Weekly downloads
85
License
MIT
Repository
github
Last release
6 years ago

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