diff --git a/README.md b/README.md index 755524b..0cd4b49 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ accessing the data. - This script is based on the deprecated `ga.js`, it is very likely that some day it will stop working. Nevertheless, it will probably work for some more years since many websites are still actively using old GA versions. - While I am not a lawyer myself, I suspect that using this script does violate most of Google's TOC as well as most -countries' data protection laws. I would strongly recommend to inform your users about your tracking activities and -perform a risk assessment. +countries' data protection laws. **Use at your own risk.** If you are looking for a "compliant" solution, have a look at [this](https://github.com/dm-guy/utm-alternative/) library, it replicates the tracking functionality of Google Analytics. @@ -23,6 +22,7 @@ library, it replicates the tracking functionality of Google Analytics. * `new GAParser([domains], limitRelevant = true)` Returns a new instance. +`domains` must be an array of all domains you want to include in tracking. # Methods @@ -30,6 +30,18 @@ Returns a new instance. Returns an object containing the parsed information. +``` +{ + userId: 'User ID', + initialVisit: 'Initial visit timestamp', + source: 'Source', + campaign: 'Campaign, + medium: 'Medium', + keywords: 'Keywords', + content: 'Content' +} +``` + * `setCookie(name = '_ga-legacy-tracking')` Sets a cookie containing a JSON string with parsed information. @@ -41,10 +53,10 @@ Adds a hidden input to the specified form containing a JSON string with parsed i # Usage ``` - - + +