xiti-smarttag-plugin
v1.1.5
Published
Xiti smarttag vanilla js implementation
Downloads
12
Maintainers
Readme
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/[email protected]/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/[email protected]/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