npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quick-ga4

v1.1.2

Published

Quick GA4 (quick-ga4.js) is a free third-party lightweight minimized page script (JavaScript) for Google Analytics. It implements the main useful functions of the official GA4 script, including Page views, Scrolls, Outbound clicks, Site search, and File d

Downloads

11

Readme

Quick GA4

Quick GA4 (quick-ga4.js) is a free third-party lightweight minimized page script (JavaScript) for Google Analytics. It implements the main useful functions of the official GA4 script, including Page views, Scrolls, Outbound clicks, Site search, and File downloads in Enhanced measurement.

Here are the instructions for using Quick GA4,GOOGLE ANALYTICS 第三方輕量最小化頁面腳本 QUICK GA4 使用說明

Using Quick GA4

<script>
window['__GA4__'] = {
    // MEASUREMENT ID
    id: 'G-XXXXXXXXXX',
    // The url which the data is sent to, the default value is below, if you want, you can set up a proxy url
    url: 'https://www.google-analytics.com/g/collect',
    session: {
        // Session timeout, the default is 1800 seconds
        timeout: 1800,
        // Threshold for engagement time(A session will become an "engaged session"), the default is 10 seconds
        engagementMin: 10,
        // How engagement time is calculated, 'focus'(default) or 'visible'
        engagementType: 'focus'
    },
    event: {
        // The trigger condition of the event page_view, the default is '*'(page_view will always be triggered).
        pageView: '*',
        // An window event used to trigger the event user_engagement, the default is 'beforeunload'.
        userEngagement: 'beforeunload',
        // A CSS selector that points to a scrolled element which is used to determine whether the event scroll will be triggered, the default is 'body', set to null to disable the event scroll.
        scroll: 'body',
        // An Array of RegExp(or a string representing a regular expression) used to exclude domains, links containing these domains won't trigger the event outbound click, the default is [], set to null to disable the event outbound.
        outbound: [],
        // The search parameters that trigger the event view_search_results, the default is 'q,s,search,query,keyword', you can add additional search parameters by &(like 'q,s&name,age'), set to null to disable the event view_search_results.
        viewSearchResults: 'q,s,search,query,keyword',
        // An RegExp used to determine which elements on the page should be considered links to download archives, the default value is below, set to null to disable the event file_download.
        fileDownload: '(?<=\.)(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$',
    },
    trigger: {
        // The page survival time needs to be greater than userEngagementMin(Seconds), otherwise, the event user_engagement will not be triggered.
        userEngagementMin: 1,
        // Threshold for scroll percentage, the default is 90, the event scroll will be triggered if the percentage is greater than or equal to scrollPercentMin.
        scrollPercentMin: 90
    },
    // This specifies whether to enable debugging mode
    debug: false
}
</script>
<script defer="true" src="<your path>/quick-ga4.js"></script>

GitHub

https://github.com/codebeatme/quick-ga4