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

@autoit-gui-skeleton/ags-component-google-analytics

v1.0.2

Published

Add the feature to track activity with Google Analytics Measurement Protocol inside an AutoIt application built with the AGS framework.

Downloads

8

Readme

AGS-component-google-analytics

Add the feature to track activity with Google Analytics Measurement Protocol inside an AutoIt application built with the AGS framework.

How to install AGS-component-google-analytics ?

In order to simplify the management of the dependencies of an AutoIt project built with AGS framework, we have diverted form its initial use the dependency manager npm, and its evolution Yarn. This allows us to manage the dependencies of an AGS project with other AutoIt libraries, and to share these AutoIt packages from the npmjs.org repository. All AGS packages hosted in this npmjs repository belong to @autoit-gui-skeleton organization

We assume that you have already install Node.js and Yarn, for example with Chocolatey, so to install AGS-component-http-request, just type in the root folder of your project where the package.json is saved :

λ  yarn add @autoit-gui-skeleton/ags-component-google-analytics --modules-folder vendor

This package is installed into the ./vendor directory. To use it in your AutoIt program, you need to include this library with this instruction:

#include 'vendor/@autoit-gui-skeleton/ags-component-google-analytics/ags-component-google-analytics.au3'

AGS's vendor directory

To install AutoIt dependencies in the ./vendor directory, and not in the default directory of Node.js ./node_modules, you must add the --modules-folder vendor option. We force this choice to avoid any confusion with a Node.js project.

Note that with an AGS project, it is not necessary to explicitly write this option on the command line, thanks to the .yarnrc file stored at the root of the project. Yarn automatically use this file to add an additional configuration of options.

 #./.yarnrc
 --modules-folder vendor

So with this file you can run yarn add @autoit-gui-skeleton/ags-component-google-analytics to install the dependencies directly into the appropriate ./vendor directory.

AGS-component-google-analytics

Description

With AGS-component-google-analytics, you can track user activity inside an AutoIt application with the Measurement Protocol.

Available methods

This library provides few methods:

Methods | Description ---------|------------- hitGAMP($payload) | Send a request HTTP POST with payload data to server GAMP hitGAMP_pageview($pageHostname, $pageName, $pageTitle) | Hit GAMP for a pageview hitGAMP_screenview($screenName) | Hit GAMP for a screenview hitGAMP_event($eventCategory, $eventAction, $eventLabel="", $eventValue="") | Hit GAMP for an event hitGAMP_screenview_AND_pageview($screenName, $pageHostname, $pageName, $pageTitle) | Hit GAMP for a screenview and a pageview

Configuration of component AGS-component-google analytics

Define behavior in configuration file ./config/parameters.ini

With AGS, you must have the configuration file ./config/parameters.ini. This file must not save with control version. You can use ./config/parameters.ini.dist as a “template” of what your parameters.ini file should look like. Set parameters here that may be different on each application. Only this file is save with control version and push on remote server.

To configure the behavior of this component, you can set its options in this configuration file. The configuration use the section AGS_GOOGLE_ANALYTICS.

## ./config/parameters.ini ##
[AGS_GOOGLE_ANALYTICS]
; [OPTIONAL] active debug output in console for all HTPP resquest send with GAMP
GAMP_DEBUG_OUPUT_CONSOLE=1

; [OPTIONAL] active tracking with Google Analytics Measurement Protocol
GAMP_ANALYTICS_CONSENT=1

If this variable are not defined in configuration file, so, by default $GAMP_DEBUG_OUPUT_CONSOLE, and $GAMP_TRACKING_ENABLE are set to False.

In this component we use an another component AGS-component-http-request. This library is used to send HTTP request in GET or POST method, and with or wihtout behind a corporate proxy, in order to send data to GA server (hit with GAMP). So you can also configure this component. For example, you can set a proxy for all HTTP connections, or set different types of timeouts. By default, this component looks in the configuration file if a proxy is defined in the PROXY variable in the AGS_HTTP_REQUEST section.

## ./config/parameters.ini ##

[AGS_HTTP_REQUEST]
; [OPTIONAL] Use a proxy for http connexion or choose NONE to disable it
# PROXY=NONE
PROXY=http://myProxy.com:20100

Set constants in ./src/GLOBALS.au3

In AGS framework all constants and global variables are set in one place ./src/GLOBALS.au3, with the exception to global variables of graphic elements which are set in each specific view file. AGS-component-google-analytics use also 5 global variables. If only one of these variables is not defined then the program returns an error and stops immediately

; The google tracking id to used
Global const $GAMP_TRACKING_ID = "UA-xxxxxxxxx-y"

; A string used as a salt in encryption algorithm
Global const $GAMP_CRYPT_SALT = "2080-M3-M?GADR1Vx"

; Application main constants
Global Const $APP_NAME = "test"
Global Const $APP_ID = "acme.test"
Global Const $APP_VERSION = "1.2.3"

Developpement

Publish a new version on Yarn

If it's the first time you publish a scoped package. The default access setting is private, but for this you need a paid account. Hence the error message. So in order to avoid HTTP 402 error, you can set the scoped package as public like this. Dont't forget to log in.

yarn login
yarn publish --access=public

About

Contributing

Comments, pull-request & stars are always welcome !

License

Copyright (c) 2018 by v20100v. Released under the MIT license.