1.0.0 • Published 3 years ago

@innodata/vue-v3-ya-metrika v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Vue v3 Yandex Metrika

vue-v3-yandex-metrika allows you to send data about visited pages to Yandex Metrika.

Installation

Install with yarn:

$ yarn add vue-v3-yandex-metrika

Install with npm:

$ npm install vue-v3-yandex-metrika --save

Ways to use

Autotracking

Pass theVueRouter instance to the plugin and let it handle everything for you (Metrika API is also available):

// your main.js
import { createApp } from 'vue'
import { createRouter } from "vue-router";
import VueYandexMetrika from 'vue-v3-yandex-metrika'                               

const router = createRouter({...}) // your routes

const app = createApp(App)

app.use(router)
app.use(VueYandexMetrika, {
	id: XXXXXXXX,
	router: router,
	env: process.env.NODE_ENV
    // other options
})

app.mount( '#app')

Manual tracking

Works without router: Metrika API

// your main.js
import { createApp } from 'vue'
import VueYandexMetrika from 'vue-v3-yandex-metrika'                               

app.use(VueYandexMetrika, {
	id: XXXXXXXX,
	env: process.env.NODE_ENV
    // other options
})

// your code
this.$metrika.hit(path)

Options:

NameDescriptionRequiredDefault
idYour tracking idTruenull
routerAutotracking if the router is passed, otherwise: manual trackingFalsenull
envAPI calls are performed only if env is "production"Falsedevelopment
scriptSrcSrc of metrika script to useFalsehttps://mc.yandex.ru/metrika/tag.js
debugIf env is not "production" and debug is true: API calls are replaced by console.log()Falsefalse
ignoreRoutesList of ignored routes namesFalse[]
skipSamePathDo not track a page visit if previous and next routes URLs matchFalsetrue
optionsOriginal Yandex Metrika optionsFalse{clickmap:true, trackLinks:true, accurateTrackBounce:true}
ababacornacorn-dynamic-importacorn-globalsJSONStreamajv-keywordsagentkeepaliveajvalign-textaggregate-erroragent-baseansi-regexansi-alignansi-stylesabbrevappend-transformaprobaanymatchansi-escapesare-we-there-yetarcharr-diffarr-flattenarray-equalargparseargv-formatterarray-uniquearrifyarray-ifyarray-unionassertassert-plusarr-unionansicolorsastral-regexasyncassign-symbolsasn1aws-sign2asn1.jsbabel-code-framebabel-generatorbabel-helper-call-delegateasync-eachbabel-helper-define-mapatob-litebabel-helper-function-namebabel-helper-hoist-variablesaws4babel-helper-regexbabel-helper-optimise-call-expressionbabel-helper-remap-async-to-generatorbabel-helpersbabel-messagesbabel-helper-replace-supersbabel-plugin-jest-hoistbabel-plugin-check-es2015-constantsbabel-helper-get-function-aritybabel-jestbabel-plugin-istanbulbabel-plugin-syntax-object-rest-spreadbabel-plugin-syntax-async-functionsbabel-plugin-syntax-exponentiation-operatorbabel-helper-explode-assignable-expressionasynckitbabel-plugin-syntax-trailing-function-commasbabel-plugin-transform-es2015-block-scoped-functionsbabel-plugin-transform-es2015-arrow-functionsbabel-plugin-transform-async-to-generatorbabel-plugin-transform-es2015-classesbabel-plugin-transform-es2015-block-scopingbabel-plugin-transform-es2015-computed-propertiesbabel-plugin-transform-es2015-destructuringbabel-plugin-transform-es2015-duplicate-keysbabel-plugin-transform-es2015-for-ofbabel-plugin-transform-es2015-literalsbabel-plugin-transform-es2015-modules-amdbabel-plugin-transform-es2015-function-namebabel-plugin-transform-es2015-modules-umdbabel-plugin-transform-es2015-modules-commonjsbabel-plugin-transform-es2015-modules-systemjsbabel-plugin-transform-es2015-object-superbabel-plugin-transform-es2015-parametersbabel-plugin-transform-es2015-sticky-regexbabel-plugin-transform-es2015-shorthand-propertiesbabel-plugin-transform-es2015-typeof-symbolbabel-plugin-transform-regeneratorbabel-plugin-transform-es2015-unicode-regexbabel-plugin-transform-es2015-template-literalsbabel-preset-envbabel-plugin-transform-strict-modebabel-plugin-transform-exponentiation-operatorbabel-polyfillbabel-runtimeatobbabel-preset-jestbabel-templatebabel-typesbabel-plugin-transform-runtimebabylonbabel-registerbalanced-matchbasebabel-traversebcrypt-pbkdfbig.jsbase32bluebirdbefore-after-hookbase64-jsbinary-extensionsbindingsbrace-expansionboxenbracesbrowserify-cipherbrowser-resolvebrorandbrowserify-signbrowserify-zlibbrowserify-desbabel-helper-builder-binary-assignment-operator-visitorbrowserslistbottleneckbrowserify-rsabuffer-frombufferbuffer-xorbsercache-basebuiltin-modulesbuiltin-status-codescacachebrowserify-aescallsitesbuiltinscall-bindbtoa-litecachedircamelcasecaniuse-litecamelcase-keyscapture-exitchalkcardinalcenter-alignci-infochownrcaselesscapture-stack-tracecli-boxeschardetcipher-basecli-cursorchokidarcli-spinnerscli-widthcliuicollection-visitcli-tableclipboardycolor-convertclean-stackcode-point-atcolorscomponent-emittercommondircombined-streamconcat-mapconcat-streamcompare-funcconfigstoreconsole-browserifyconstants-browserifycontent-type-parserconsole-control-stringsclass-utilscolor-nameconventional-commit-typesconventional-changelog-angularconvert-source-mapcopy-concurrentlyconventional-commits-filtercore-jscore-util-iscreate-error-classconventional-changelog-writerconventional-commits-parsercreate-hmaccopy-descriptorcssomcrypto-browserifycross-spawncreate-hashcrypto-random-stringcssstylecyclistdde-indentdashdashdebugdateformatdecode-uri-componentdecamelize-keysdecamelizededentcosmiconfigcreate-ecdhdeep-isdefault-require-extensionsdelayed-streamdefine-propertiesdefine-propertydelegatesdeep-extenddetect-indentdeprecationdetect-filediffdiffie-hellmandomain-browserdot-propduplexifyduplexer2ellipticduplexer3dir-globecc-jsbnemojis-listelectron-to-chromiumemoji-regexend-of-streamenhanced-resolveenv-ciencodingerror-exerror-stack-parsererrnoes6-iteratordes.jses6-promisees6-setes6-promisifyerr-codees6-weak-mapescodegenes6-mapescape-string-regexpescopeestraverseesprimaesutilsevent-emitterevp_bytestokeyesrecurseexit-hookeventsexec-shexpand-bracketsexpand-rangees5-extes6-symbolextextendextend-shallowexpectexternal-editorextglobfast-deep-equalextsprintffast-levenshteinfast-json-stable-stringifyfastqfast-globexpand-tildefilename-regexfiguresexecafilesetfiggy-puddingfill-rangefind-babel-configfind-cache-dirfind-rootfind-upfindup-syncfind-versionsfb-watchmanflush-write-streamfor-ownfor-infind-node-modulesform-datafrom2fragment-cachefile-uri-to-pathfs-exists-syncfs-extragaugefs-write-stream-atomicget-caller-fileforever-agentfseventsget-valueget-intrinsicfunction-bindgetpassgit-config-pathgithub-url-from-gitglobget-stream@octokit/restglob-baseglobalsglob-parentglobal-prefixglobal-dirsglobal-modulesgotgit-log-parsergrowlyhar-schemagraceful-fshard-rejectionhar-validatorhashas-ansihandlebarshas-symbolshas-valuehas-unicodehas-valueshash.jshmac-drbghehome-or-tmphomedir-polyfillhash-basehook-stdhas-flaghtml-encoding-snifferhttp-cache-semanticshttp-signatureglobbyhosted-git-infohttps-browserifyhumanize-msiferrhuman-signalsiconv-litehttps-proxy-agentieee754import-freshhttp-proxy-agentimport-lazyimurmurhashindent-stringinfer-ownerimport-fromignoreinheritsinflightinto-streaminiinvariantfs.realpathinvert-kvipinquireris-builtin-moduleis-bufferinterpretis-accessor-descriptoris-binary-pathis-descriptoris-core-moduleis-data-descriptoris-equal-shallowis-ciis-dotfileis-extendableis-arrayishis-dockeris-finiteis-globis-installed-globallyis-npmis-extglobis-objis-path-insideis-numberis-primitiveis-posix-bracketis-plain-objis-redirectis-retry-allowedis-utf8is-fullwidth-code-pointis-streamis-text-pathisarrayisexeis-plain-objectisstreamissue-parseristanbul-apiisobjectistanbul-lib-instrumentistanbul-lib-hookistanbul-lib-coverageis-windowsistanbul-reportsjest-changed-filesis-wsljava-propertiesjest-environment-jsdomjest-docblockjest-diffistanbul-lib-source-mapsjest-get-typejest-matcher-utilsis-typedarrayjest-configistanbul-lib-reportjest-matchersjest-environment-nodejest-mockjest-message-utiljest-resolve-dependenciesjest-runnerjest-regex-utiljest-runtimejest-utiljest-resolvejest-snapshotjest-validatejest-vue-preprocessorjsdomjs-tokensjsescjsbnjson-parse-better-errorsjson-loaderjson-schemajest-jasmine2jest-haste-mapjson-stringify-safejs-yamljson5json-stable-stringifyjsonfilejson-parse-even-better-errorsjsprimklawlatest-versionkind-oflazy-cachelcidlcov-parselevnlevenlines-and-columnsload-json-fileloader-utilsloader-runnerjsonifylocate-pathlodashlodash.capitalizelodash.escaperegexplodash.getlodash.isstringlodash.setlodash.isplainobjectlodash.maplodash.toarraylodash.uniqlog-driverlodash.uniqbylog-symbolslodash.ismatchlongestloose-envifylowercase-keyslru-cachemake-dirmacos-releasemakeerrormap-cachemap-objmap-visitmath-randomjson-schema-traversemarkedmemmeowmemory-fsmerge-streamjsonparsemarked-terminalmergemicromatchmimemake-fetch-happenmime-dbmiller-rabinmimic-fnminimalistic-assertminimalistic-crypto-utilsmin-indentminimatchmississippimerge2minimistminimist-optionsmkdirpmixin-deepmove-concurrentlymime-typesnanmsmute-streamnatural-compareneo-asyncnanomatchmodify-valuesnice-trynext-ticknode-emojinode-fetchnerf-dartnode-int64node-libs-browsernormalize-package-datanoptnode-fetch-npmnormalize-pathnpm-registry-fetchnode-notifiernpmnormalize-urlnpmlognpm-package-argmd5.jsnpm-profileoauth-signobject-assignnumber-is-nanobject-visitobject-copyobject.pickobject.omitoctokit-pagination-methodsonetimeonceopencollectiveopnoptimistobject.assignos-browserifyoptionatoros-localeos-homediros-nameos-shimos-tmpdirp-cancelablenpm-run-pathosenvp-finallyp-is-promisep-filterp-limitp-reduceobject-keysp-locatep-retrynwmatcherp-trypad-rightp-mappakoparallel-transformparse-git-configparse-github-repo-urlparse-globparent-moduleparse-jsonparse-passwdpath-dirnameparse5pascalcasepath-is-absolutepath-is-insidepath-parsepath-existspath-keypath-browserifypicomatchperformance-nowpath-typepkg-confpifypinkie-promisepinkiepkg-dirprepend-httppbkdf2prelude-lsprivatepreservepretty-formatpromise-inflightpromise-retryprocessprocess-nextick-argspseudomapprrpslpackage-jsonpublic-encryptpumpifyqpumpquerystring-es3qspunycodequerystringparse-asn1quick-lrurandomfillrandomaticrcrandombytesreadable-streamread-pkg-upread-pkgrechoirredentreaddirpredeyedregenerateregenerator-transformposix-character-classesregex-cacheregexpu-coreregex-notregistry-urlqueue-microtaskregjsgenregjsparserremove-trailing-separatorrepeat-stringrepeatingrequest-promiserepeat-elementrequest-debugregistry-auth-tokenrequire-directoryresolve-dirrequestregenerator-runtimerequire-main-filenameresolve-fromretresolverequest-promise-coreresolve-urlretryrimrafright-alignreusifyripemd160right-padrsvprxrxjssafe-bufferrun-queuerestore-cursorsafe-regexsaxsafer-bufferrun-asyncsemver-diffserialize-javascriptsemversemver-regexset-valueset-blockingsanerun-parallelshelljsshebang-commandsetimmediatesha.jsshebang-regexshellwordssignal-exitslashsmart-buffersnapdragonsignalesnapdragon-nodesnapdragon-utilsource-list-mapsockssocks-proxy-agentsource-mapsource-map-resolvespawn-syncspdx-exceptionsspawn-error-forwardersource-map-urlsource-map-supportspdx-expression-parsesplit-stringsshpkspdx-license-idssprintf-jsssristatic-extendstealthy-requirestackframestream-browserifystream-eachstream-httpstream-combiner2stream-shiftspdx-correctstring-lengthstring_decoderstring-widthstrip-bomstringify-clonestrip-ansistrip-eofsupports-colorstrip-indentstrip-final-newlinestrip-json-commentstapablesymbol-treetemp-dirtempysplit2test-excludetext-extensionsthroatthroughtimed-outtmpthrough2timers-browserifyto-fast-propertiesto-arraybuffertmplto-object-pathto-regextough-cookieto-regex-rangetr46traversetravis-citrim-newlinestrim-off-newlinestrim-righttslibtty-browserifytunnel-agenttypesupports-hyperlinkstype-checksplittypedarraytypescriptuglify-to-browserifyuglify-jsuglifyjs-webpack-pluginterm-sizeunique-filenameunion-valueunique-slugtweetnacltype-festunderscore.stringuniversalifyunique-stringunset-valueupdate-notifierunzip-responseuri-jsurixuniversal-user-agenturlurl-joinurl-parse-laxuseutiluser-homeutil-deprecatevalidate-npm-package-licenseupathvalidate-npm-package-namevalidatorvm-browserifyverrorvue-template-es2015-compilervue-template-compileruuidvue-class-componentwalkerwebpack-sourceswhatwg-encodingwatchwhatwg-urlwhich-modulewhichwide-alignwidest-linewindows-releaseword-wrapwatchpack-chokidar2wordwrapworker-farmwrap-ansiwrappywrite-file-atomicxdg-basedirxml-name-validatory18nxtendyallistvue-property-decoratorwebidl-conversionsbabel-plugin-transform-es2015-spreadbn.jsyamlyargs-parserwatchpackwindow-sizeyargs
1.0.0

3 years ago