npm install -S analytica.clickimport { AnalyticaClickProvider } from 'analytica.click';<AnalyticaClickProvider values={{ analyticaToken: 'your api token' }} >
<Your Components....>
</AnalyticaClickProvider>
import { useAnalytica } from 'analytica.click';
...
let lastLocation='';
...
YourComponent(){
const { page } = useAnalytica();
useEffect(() => {
if (<current path name> !== lastLocation) {
// will use window location
page({});
lastLocation = <current path name>;
}
}, [page, <current path name>]);
...
}
import { useAnalytica } from 'analytica.click';
...
const { event } = useAnalytica();
event({ eventName: 'my event name' });
- name: notify analytica of build
if: always()
uses: andreigecanalytica/analytica.click.gh@v2
with:
ANALYTICA_TOKEN: '${{ secrets.ANALYTICA_TOKEN }}'
Set the token to your project Admin Api Key. Server-side requests authenticated with the Admin Api Key bypass bot filtering; the regular Api Key is treated as client traffic and can be dropped as a bot.