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

ja_google_analytics

v2.2.17

Published

JourneyApps specific Google Analytics

Downloads

25

Readme

Google Analytics For Oxide 📝

Constants

  • APP_NAME:string = {Your GA app name}
  • TRACKING_ID:string = {Your GA app tracking id}
  • If you do not know your tracking id go to Admin > Select your property > Tracking Info > Tracking code. The id will be located at the top of the section.

ga.ts

  • Create an app module file and insert the code from the lib.ts file.
  • Go to any view in your app that you want to track and import the lib file import * as GoogleAnalytics from '~/lib/ga.ts';
  • In both the init and resume function add the following code await GoogleAnalytics.screenview(screenview_name: string);
  • If you want to track an event, just call await GoogleAnalytics.event(category: string, event_action: string, label: string, value: string | number); in any sumbit handler function.

ga_task.ts

  • Create a CloudCode Task with the name ga_task to run in the background if the app is offline.
  • Copy this model code below and add it to the bottom of the data model section
   <model name="google_analytics" label="SYSTEM: Google Analytics">
        <field name="action" label="Action" type="single-choice">
            <option key="screenview">screenview</option>
            <option key="event">event</option>
        </field>
        <field name="app_env" label="App Environment" type="text" />
        <field name="screenview_name" label="Screeview Name" type="text" />
        <field name="user_reference" label="User Reference" type="text" />
        <field name="created_at" label="Created At" type="datetime" />
        <field name="app_version" label="App Version" type="text" />
        <field name="platform" label="Platform" type="text" />
        <field name="role" label="Role" type="text" />
        <field name="event_category" label="Event Category" type="text" />
        <field name="event_action" label="Event Action" type="text" />
        <field name="event_label" label="Event Label" type="text" />
        <field name="event_value" label="Event Value" type="text" />
        <field name="connection" label="Connection" type="single-choice">
            <option key="Offline">Offline</option>
            <option key="Online">Online</option>
        </field>
        <field name="locale" label="Locale" type="text" />
        <field name="processed" label="Processed" type="boolean" />
        <webhook type="ready" receiver="cloudcode" action="google_analytics">
            <field name="processed" required="true" embed="true" />
        </webhook>
        <display>{screenview_name}</display>
   </model> 
  • Copy and paste the code from the ga_task.ts file in the CloudCode Task.