@sajari/sdk-react
Version:
React SDK for the Sajari API
34 lines (33 loc) • 1.22 kB
TypeScript
import { Analytics } from "./analytics";
export declare class GoogleAnalytics {
private id;
private param;
private unregisterFunctions;
/**
* Constructs a GoogleAnalytics object.
* @param {Analytics} analytics The analytics object to attach to.
* @param {string} [id=undefined] The name of the ga global object. Defaults to "ga" or "_ua" if one isn't supplied.
* @param {string} [param="q"] The URL parameter to use to indicate a search. Default to "q".
*/
constructor(analytics: Analytics, id?: string, param?: string);
/**
* Stops this object listening for events.
*/
detatch: () => void;
/**
* Sends a page view event if ga is found on the page and we're not in dev mode.
*/
sendGAPageView(body: string): void;
/**
* Callback for when the body has been reset. Calls sendGAPageView.
*/
onBodyReset: (body: string) => void;
/**
* Callback for when a result has been clicked. Calls sendGAPageView.
*/
onResultClicked: (body: string) => void;
/**
* Callback for when the page has been closed. Calls sendGAPageView.
*/
onPageClose: (body: string) => void;
}