All files / owid-grapher/site SiteAnalytics.ts

54.17% Statements 13/24
100% Branches 0/0
0% Functions 0/5
54.17% Lines 13/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251x 1x 1x 1x     1x 1x       1x 1x     1x 1x     1x 1x     1x  
import { GrapherAnalytics } from "../grapher/core/GrapherAnalytics" // todo: make these less tightly coupled
 
export class SiteAnalytics extends GrapherAnalytics {
    logCovidCountryProfileSearch(country: string) {
        this.logToGA("COVID_COUNTRY_PROFILE_SEARCH", country)
    }
 
    logPageNotFoundError(url: string) {
        this.logToAmplitude("NOT_FOUND", { href: url })
        this.logToGA("Errors", "NotFound", url)
    }
 
    logChartsPageSearchQuery(query: string) {
        this.logToGA("ChartsPage", "Filter", query)
    }
 
    logPageLoad() {
        this.logToAmplitude("OWID_PAGE_LOAD")
    }
 
    logDataValueAnnotate(label: string) {
        this.logToGA("Hover", "data-value-annotate", label)
    }
}