Append content to copied clipboard text.
- Append your product name and source URL to copied text from your web page
- Custom copied character count threshold for addiing the content
- Tag copy events in Google Analytics
- Lodash merge function
npm install @informatix8/source-attribution --save-dev
<script src="https://unpkg.com/@informatix8/source-attribution/dist/source-attribution.all.umd.js"></script>
new SourceAttribution({
productName: 'My Product'
});
Google Analytics instructs that you add their javascript to the <head>
of your document.
<head>
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-x"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxxxx-x');
</script>
</head>
npm run dev
npm run build
npm run build
git tag -a vX.Y.Z
git push origin master
git push origin --tags
npm publish --access=public .