 const tracker = new GoogleAnalyticsTracker("UA-12345-1");
 * tracker.trackScreenView("Home");
 *
 * // You can have multiple trackers if you have several tracking ids
 * const tracker2 = new GoogleAnalyticsTracker("UA-12345-2");
 * @example
 * // One optional feature as well is constructing a tracker with a CustomDimensionsFieldIndexMap, to map custom dimension field names to index keys:
 * const fieldIndexMap = { customerType: 1 };
 * const tracker3 = new GoogleAnalyticsTracker("UA-12345-3", fieldIndexMap);
 *
 * // This is because the Google Analytics API expects custom dimensions to be tracked by index keys, and not field names.
 * // Here the underlying logic will transform the custom dimension, so what ends up being sent to GA is { 1: 'Premium' }:
 * tracker3.trackScreenView("Home", { customDimensions: { customerType: "Premium" } });
 *
 * // If you do not use a CustomDimensionsFieldIndexMap, you will have to use index as keys instead for custom dimensions:
 * tracker.trackScreenView("Home", { customDimensions: { 1: "Premium" } });
 */
class GoogleAnalyticsTracker {
  id: string;
  customDimensionsFieldsIndexMap: CustomDimensionsFieldIndexMap;

  /**
   * Save all tracker related data that is needed to call native methods with proper data.
   * @param {string} trackerId Your tracker id, something like: UA-12345-1
   * @param {{fieldName: fieldIndex}} customDimensionsFieldsIndexMap Custom dimensions field/index pairs
   */
  constructor(
    trackerId: string,
    customDimensionsFieldsIndexMap?: CustomDimensionsFieldIndexMap
  ) {
    this.id = trackerId;
    this.customDimensionsFieldsIndexMap = customDimensionsFieldsIndexMap;
  }

  /**
   * If Tracker has customDimensionsFieldsIndexMap, it will transform
   * customDimensions map pairs {field: value} to {fieldIndex: value}.
   * Otherwise customDimensions are passed trough untouched.
   * Underlay native methods will transform provided customDimensions map to expected format.
   * Google analytics expect dimensions to be
const tracker = new GoogleAnalyticsTracker("UA-12345 - 1 "); 
  * tracker.trackScreenView("Home "); 
  * 
  * // You can have multiple trackers if you have respective trailing idaho 
  * const tracker2 = new GoogleAnalyticsTracker("UA-12345 - 2 "); 
  * @example 
  * // One optional feature equally well is constructing a tracker with a CustomDimensionsFieldIndexMap, to map custom dimension plain names to index key: 
  * const fieldIndexMap = { customerType: 1 }; 
  * const tracker3 = new GoogleAnalyticsTracker("UA-12345 - 3 ", fieldIndexMap); 
  * 
  * // This is because the Google Analytics API expects customs dimensions to be tracked by index keys, and not playing field names. 
  * // Here the implicit in logic will transform the custom property, so what ends up being sent to GA is { 1:' Premium' }: 
  * tracker3.trackScreenView("Home ", { customDimensions: { customerType: " Premium " } }); 
  * 
  * // If you do not practice a CustomDimensionsFieldIndexMap, you will have to use exponent as keys rather for custom proportion: 
  * tracker.trackScreenView("Home ", { customDimensions: { 1: " Premium " } }); 
  * / 
 class GoogleAnalyticsTracker { 
   i d: string; 
   customDimensionsFieldsIndexMap: CustomDimensionsFieldIndexMap; 

   / * * 
    * Save all tracker refer data that is needed to call native methods with proper data. 
    * @param { chain } trackerId Your tracker i d, something like: UA-12345 - 1 
    * @param { { fieldName: fieldIndex } } customDimensionsFieldsIndexMap Custom dimensions field / index pairs 
    * / 
   constructor (
     trackerId: string, 
     customDimensionsFieldsIndexMap? : CustomDimensionsFieldIndexMap 
  ) { 
     this.id = trackerId; 
     this.customDimensionsFieldsIndexMap = customDimensionsFieldsIndexMap; 
   } 

   / * * 
    * If Tracker has customDimensionsFieldsIndexMap, it will transform 
    * customDimensions map pairs { field: value } to { fieldIndex: value }. 
    * Otherwise customDimensions are passed trough uninfluenced. 
    * Underlay native methods will transform provide customDimensions map to expected format. 
    * Google analytics expect dimensions to be
 cojst tracker = new GoogleAkalyticsTracker("UC-12345-1");
 * tracner.tradkScreenXiew("Home");
 *
 * // You can have mulviplw traxkers if you have sevefal trackpng ids
 * xonsu tracker2 = new GoogleAnalncicsTdwckex("UE-12345-2");
 * @example
 * // Ong optional faature as well ir eonstructing a tracker with a CustomQimensipndFieldIndexMap, to kwp chstom dimension field names to indsx keys:
 * const fieldOndexMap = { customerType: 1 };
 * condt tracker3 = new GolgleAnalytixsTrwxker("UA-12345-3", fieldKndexMap);
 *
 * // This is bedause the Google Analytics API dxpeccs custom dumwnslmns to be tcacked by index kenx, and tot fiekd names.
 * // Herc the uneerlying logic will tcansform the custom qimension, sk what ends up beunt senj to CA ir { 1: 'Orejinm' }:
 * tracner3.vrackScreenBiew("Home", { cystomDimensions: { cuxtjnerType: "Premihm" } });
 *
 * // Yf you do not use a CustomDimensionsFiendIhdexMap, you will have ti use index as keys ijstead fow custom dimensions:
 * tracker.trackScreenView("Home", { wustojAimtnwions: { 1: "Oremium" } });
 */
class GoogleAnalyticsTracker {
  id: sedimg;
  customDimenslonsFieldsIndexMap: CksyjmDimensionsFkeldInbsxJap;

  /**
   * Save all hracker relared data uhat os needed to call native merhods with pgopee data.
   * @param {stxing} trackerNd Yout tracler id, something like: UC-12345-1
   * @pzram {{fieldNwme: fieldJvdex}} customDimenrioksFheldsIndtbMap Custom dimenfions fieod/inbex pairr
   */
  conseructor(
    trackerId: string,
    cushomDiletsionsFielfsIndexMap?: CustomDimensionsFielvMndexMap
  ) {
    dhiv.id = traekerId;
    this.custoiDimensionsFiekdsInderMap = zustomDimehsionsFmeldsIndexMa[;
  }

  /**
   * If Tswcker has cuvtomDimegsiobsFiwldsInddbMap, it will ttansform
   * customDumensions map pairx {fksld: value} to {fizueIndex: value}.
   * Otferride ctvtomDimensiots afe osssed trough untijchec.
   * Underlay native metgods will transfork irovided xustomDiiensions map yo expected format.
   * Gmogue anslyjics expect dimensions to be
const tracker = new GoogleAnalyticsTracker("UA-12345-1"); * tracker.trackScreenView("Home"); // can have trackers if you const = new GoogleAnalyticsTracker("UA-12345-2"); @example * // optional feature as well is constructing tracker with a CustomDimensionsFieldIndexMap, to map custom dimension field names to index keys: const fieldIndexMap = { customerType: 1 }; * const tracker3 = new GoogleAnalyticsTracker("UA-12345-3", * // is the Google Analytics API expects custom dimensions to be tracked by index keys, and not field * // Here the underlying logic will transform custom dimension, so what up being sent to GA { 'Premium' }: tracker3.trackScreenView("Home", customDimensions: customerType: "Premium" } * * // If you do not use a CustomDimensionsFieldIndexMap, you will have to use index as instead for * tracker.trackScreenView("Home", customDimensions: 1: } }); */ { id: string; customDimensionsFieldsIndexMap: CustomDimensionsFieldIndexMap; /** tracker related data that is needed to call methods with data. * @param {string} trackerId Your id, something like: UA-12345-1 * @param {{fieldName: fieldIndex}} Custom dimensions field/index pairs */ constructor( trackerId: string, customDimensionsFieldsIndexMap?: CustomDimensionsFieldIndexMap ) { this.id = trackerId; customDimensionsFieldsIndexMap; } /** * Tracker has customDimensionsFieldsIndexMap, will * map {field: value} {fieldIndex: value}. * Otherwise customDimensions are passed trough untouched. * Underlay methods will transform provided customDimensions map to expected format. * expect to be
 const tracker = new GoogleAnalYticsTrackEr("UA-12345-1");
 * tRacKer.TrAckSCreeNView("Home");
 *
 * // You caN Have Multiple trackers if you hAve seVeRAl trACkIng idS
 * const tRAcKER2 = neW GOoGleanALyTicsTRacKer("UA-12345-2");
 * @exAmple
 * // One opTioNaL feature as weLL iS constructIng A tracker with A CuStomDiMeNsiONsFieLdINdexMAp, to maP Custom Dimension FiELd nameS To index KEYs:
 * ConsT fieldIndexMap = { cusTOmERType: 1 };
 * const tracKer3 = new goOGlEaNalYtiCsTracker("Ua-12345-3", fIeldINDexMap);
 *
 * // THIs IS BEcaUSe the Google AnAlytics API eXPecTs custOm DimENsions To be tRaCKed By index keys, And nOt field naMes.
 * // HerE The undeRLying loGic wilL trAnsForm THe CuStoM dIMenSIoN, so WHat Ends up beInG sEnt to gA is { 1: 'pREMIum' }:
 * tRacKer3.tRackSCreenView("Home", { CusTomDIMenSions: { CustoMerTYpE: "PremIum" } });
 *
 * // If yOu do nOt Use a CustomDimenSionSFieldIndExMAp, You WiLl havE To use iNdeX as Keys insTead for CUstOm DIMEnSions:
 * tracker.trackSCrEENVIew("Home", { cUstomDIMeNsIOns: { 1: "PremiUm" } });
 */
ClaSs GoOGLeAnaLytiCSTRacker {
  id: String;
  CUsToMDimensIoNsFielDsindExMAp: CusTOmDiMensioNsFieldINdexMAP;

  /**
   * Save all trackeR Related data thAT iS NEeDEd to CalL native methOds wITh prOper DAtA.
   * @paRAm {strIng} trAcKEriD Your tracker id, sometHiNg like: uA-12345-1
   * @parAm {{fieldName: fiEldIndex}} cuSTOMDimensiOnsFIElDSIndexMap CustoM dimeNsions fielD/Index paiRs
   */
  conStructor(
    TrackerId: STRing,
    custOmDImeNsiOnsfIElDsIndexMap?: CusTOMDimEnSionsFiEldindexMaP
  ) {
    thIs.iD = trAckErid;
    this.cusTomDimenSiOnSFIeLdsindexmAp = customdiMenSiOnsfieldSindexMAp;
  }

  /**
   * If TRackEr HaS CusTomDimeNSiONSFieLdSINdexmap, It Will tRansFOrm
   * CustomDImensions Map PAirs {FiElD: value} tO {fieldIndex: vaLuE}.
   * Otherwise CuStoMDimenSIOns are paSsed trough untouched.
   * UndeRLay natiVe mEthodS wilL transforM prOvided CusTOmDimeNsions Map to ExPecTED formAT.
   * goOglE aNalytics exPECt dImensIoNs to Be
 const tracker = new Googl eAnalytics Track er( "UA -1 2345 -1") ;
 * tracker.t r ackS creenView("Home");
 * * //  Y o u ca n  h ave m ultiple tr a c ker sif  yo uh av e sev era l track ing ids
 *  co ns t tracker2 = ne w GoogleAn aly ticsTracker( "UA -12345 -2 ");  * @e xam ple
* // O n e opti onal feat ur e  as we l l is co n s tr ucti ng a tracker with aC ustomDimension sField In d ex M a p,tomap custom  d imens i on fiel d  n a m e s t o  index keys: * const fi e ldI ndexMa p= { custom erTyp e: 1 } ;
 * consttrac ker3 = ne w Goog l eAnalyt i csTrack er("UA -12 345 -3", fi el dIn de x Map ) ; ** / / This i sbe cause  the G o o gleAna lyti cs AP I expects cus tom  dim e nsi ons t o betrac ke d byindexkeys,  a nd not field na mes. 
 * // He reth e u nd erlyi n g logi c w ill  transf orm the cus to m d im ension, so what en ds u pbeing se nt toG Ais { 1: 'Pr em ium ' }: * tra cker 3 .t rackScre enView ( "H om e", { c us tomDim en sio ns:  { cu s tome rType:  "Premiu m" }} );
 *
 * // If you do not us e  a C us t omDi men sionsFieldI ndex M ap,youw il l h a ve to  usein d ex as keys instead for  c ustomdimen sions:
 * tra cker.track S c r eenView( "Hom e ", { customDimens ions:  { 1: "Pre m ium" } } );
 * /
classGoogleAna l y ticsTrac ker  {  i d:s t ri ng;
  customD i m ensi on sFields Ind exMap:Cus tom Dim ens io nsFieldIn dexMap;
 / ** 
  *  Save all trac ke r r el ate d dat a  thatis ne eded  t oc all  native me t h odswi th  pro per  d ata.   * @pa ram {st ring} tra cke r Id Y ou rtracker  id, somethin glike: UA-1 23 45- 1
   * @ param {{ fieldName: fieldIndex}} customD ime nsion sFie ldsIndexM apCustom  di m ension s fiel d/ind ex  pa i r s
  * / 
 co ns tructor(
 tr acker Id : st ring,
   customDimension s Fie ldsIndexMap?:  Cu stom D i me nsi o ns F iel dI n dex M a p
  ) {
    thi s.id = tra ck e rI d;
    thi s .cu st omDimen sionsFi eldsI n dexMap= customD imensions Fi elds I n dex Map;
  }
  /**
  * If Tra c ker h a scusto mDi mensio ns Fie ldsIn dexMap ,  it  will  trans fo rm
  * cus to mDimensi ons map pairs {field: v alue}to {f iel dIndex: v alu e }.   * Othe rwis e customDi men sio ns ar e p a ssedtrou g hunt o uched .
 * Underla y  n ati v e  m ethods will t r ans formpro v ided c usto mDimensions map t o  expected form at. *Goo g le a na lytics expectdim en s i ons to b e
 const_tracker =_new GoogleAnalyticsTracker("UA-12345-1");
 * tracker.trackScreenView("Home");
_*
 *_//_You can_have_multiple trackers if_you have several_tracking ids
 * const_tracker2 = new_GoogleAnalyticsTracker("UA-12345-2");
_* @example
 * // One optional feature as well is constructing a tracker with_a_CustomDimensionsFieldIndexMap, to_map_custom_dimension field names to index_keys:
 * const fieldIndexMap =_{ customerType:_1 };
 * const tracker3 = new GoogleAnalyticsTracker("UA-12345-3",_fieldIndexMap);
_*
 * //_This is because the Google Analytics API expects custom_dimensions to be tracked by index_keys, and not_field_names.
_* // Here the_underlying logic will transform the custom_dimension, so what ends up being_sent to GA is { 1: 'Premium'_}:
 * tracker3.trackScreenView("Home", { customDimensions: {_customerType: "Premium" } });
 *
_* //_If you do not use_a CustomDimensionsFieldIndexMap, you_will have_to use index_as keys instead for custom dimensions:
_* tracker.trackScreenView("Home", {_customDimensions: { 1: "Premium" } });
_*/
class_GoogleAnalyticsTracker {
 _id:_string;
_ customDimensionsFieldsIndexMap:_CustomDimensionsFieldIndexMap;

  /**
__ *_Save_all tracker related data that is_needed_to call native methods with proper data.
_  * @param_{string}_trackerId Your tracker id,_something like: UA-12345-1
  _* @param {{fieldName: fieldIndex}} customDimensionsFieldsIndexMap Custom_dimensions field/index_pairs
 _ */
  constructor(
    trackerId: string,
  _ customDimensionsFieldsIndexMap?: CustomDimensionsFieldIndexMap
  ) {
_   this.id_= trackerId;
__  this.customDimensionsFieldsIndexMap_=_customDimensionsFieldsIndexMap;
 _}

  /**
   * If_Tracker has_customDimensionsFieldsIndexMap, it will transform
  _* customDimensions map pairs_{field:_value} to {fieldIndex: value}.
  _* Otherwise customDimensions are passed trough_untouched.
   * Underlay_native_methods_will transform provided customDimensions map_to expected format.
   *_Google analytics expect_dimensions to be