googleanalytics / autotrack

Automatic and enhanced Google Analytics tracking for common user interactions on the web.
Other
4.92k stars 560 forks source link

command not found: autotrack #253

Closed LouiseReid closed 4 years ago

LouiseReid commented 4 years ago

I'm trying to create a custom autotrack.js file to only include the bundled code for clean url tracker by running this command

autotrack -o autotrack.js -p cleanUrlTracker

my package.json has autotrack listed as a dependency

    "autotrack": "2.4.1",

but I get command not found : autotrack. What am I doing wrong?

diminishedprime commented 4 years ago

Where are you running the autotrack command from? The command line? That error sounds like it's not on your path. You probably need to either:

  1. Install autotrack globally via npm
    npm install -g autotrack
  2. run autotrack using npm by creating a new "scripts" entry in the package.json
    ...
    scripts: {
     "autotrack": "autotrack -o autotrack.js -p cleanUrlTracker"
    }
    ...
  3. If you have yarn installed, just run
    yarn run autotrack -o autotrack.js -p cleanUrlTracker
LouiseReid commented 4 years ago

Thanks @diminishedprime