function buildEvents() {
  array.events = [];
  if($('#catalog-1-checkbox').is(':checked')){
    formatCatalog("catalog-1");
    array["catalog-1"].results = []
    for (i = 0; i < array["catalog-1"].data.length; i++) {
      array.events.push({
        "action": "Product Catalog Update", 
        "itemAction": "View Item",
        "debug": {"explanations": true },
        "flags": {"noCampaigns": true, "pageView": true },
        "source": {"channel": "Demo Builder", "local": "enGB" },
        "user": {"id": "bot@ukisolutions.com"},
        "catalog": {
          "Product": array["catalog-1"].data[i]
        }
      });
    }
  }
  if($('#catalog-2-checkbox').is(':checked')){
    formatCatalog("catalog-2");
    array["catalog-2"].results = []
    for (i = 0; i < array["catalog-2"].data.length; i++) {
      array.events.push({
        "action": "Article Catalog Update", 
        "itemAction": "View Item",
        "debug": {"explanations": true },
        "flags": {"noCampaigns": true, "pageView": true },
        "source": {"channel": "Demo Builder", "local": "enGB" },
        "user": {"id": "bot@ukisolutions.com" },
        "catalog": {
          "Article": array["catalog-2"].data[i]
        }
      });
    }
  }
  if($('#catalog-3-checkbox').is(':checked')){
    formatCatalog("catalog-3");
    array["catalog-3"].results = []
    for (i = 0; i < array["catalog-3"].data.length; i++) {
      array.events.push({
        "action": "Blog Catalog Update", 
        "itemAction": "View Item",
        "debug": {"explanations": true },
        "flags": {"noCampaigns": true, "pageView": true },
        "source": {"channel": "Demo Builder", "local": "enGB" },
        "user": {"id": "bot@ukisolutions.com" },
        "catalog": {
          "Blog": array["catalog-3"].data[i]
        }
      });
    }
  }
  console.log(array);
}
// Function to validate each catalog type based on default settings
Function to validate each catalog type based on default settings
Function to validate each catalog type based on default settings
function buildEvents() {
  array.events = [];
  if($('#catalog-1-checkbox').is(':checked')){
    formatCatalog("catalog-1");
    array["catalog-1"].results = []
    for (i = 0; i < array["catalog-1"].data.length; i++) {
      array.events.push({
        "action": "Product Catalog Update", 
        "itemAction": "View Item",
        "debug": {"explanations": true },
        "flags": {"noCampaigns": true, "pageView": true },
        "source": {"channel": "Demo Builder", "local": "enGB" },
        "user": {"id": "bot@ukisolutions.com"},
        "catalog": {
          "Product": array["catalog-1"].data[i]
        }
      });
    }
  }
  if($('#catalog-2-checkbox').is(':checked')){
    formatCatalog("catalog-2");
    array["catalog-2"].results = []
    for (i = 0; i < array["catalog-2"].data.length; i++) {
      array.events.push({
        "action": "Article Catalog Update", 
        "itemAction": "View Item",
        "debug": {"explanations": true },
        "flags": {"noCampaigns": true, "pageView": true },
        "source": {"channel": "Demo Builder", "local": "enGB" },
        "user": {"id": "bot@ukisolutions.com" },
        "catalog": {
          "Article": array["catalog-2"].data[i]
        }
      });
    }
  }
  if($('#catalog-3-checkbox').is(':checked')){
    formatCatalog("catalog-3");
    array["catalog-3"].results = []
    for (i = 0; i < array["catalog-3"].data.length; i++) {
      array.events.push({
        "action": "Blog Catalog Update", 
        "itemAction": "View Item",
        "debug": {"explanations": true },
        "flags": {"noCampaigns": true, "pageView": true },
        "source": {"channel": "Demo Builder", "local": "enGB" },
        "user": {"id": "bot@ukisolutions.com" },
        "catalog": {
          "Blog": array["catalog-3"].data[i]
        }
      });
    }
  }
  console.log(array);
}
function buildEvents ( ) { array . events = [ ] ; if ( $ ( '#catalog-1-checkbox' ) . is ( ':checked' ) ) { formatCatalog ( "catalog-1" ) ; array [ "catalog-1" ] . results = [ ] for ( i = 0 ; i < array [ "catalog-1" ] . data . length ; i ++ ) { array . events . push ( { "action" : "Product Catalog Update" , "itemAction" : "View Item" , "debug" : { "explanations" : true } , "flags" : { "noCampaigns" : true , "pageView" : true } , "source" : { "channel" : "Demo Builder" , "local" : "enGB" } , "user" : { "id" : "bot@ukisolutions.com" } , "catalog" : { "Product" : array [ "catalog-1" ] . data [ i ] } } ) ; } } if ( $ ( '#catalog-2-checkbox' ) . is ( ':checked' ) ) { formatCatalog ( "catalog-2" ) ; array [ "catalog-2" ] . results = [ ] for ( i = 0 ; i < array [ "catalog-2" ] . data . length ; i ++ ) { array . events . push ( { "action" : "Article Catalog Update" , "itemAction" : "View Item" , "debug" : { "explanations" : true } , "flags" : { "noCampaigns" : true , "pageView" : true } , "source" : { "channel" : "Demo Builder" , "local" : "enGB" } , "user" : { "id" : "bot@ukisolutions.com" } , "catalog" : { "Article" : array [ "catalog-2" ] . data [ i ] } } ) ; } } if ( $ ( '#catalog-3-checkbox' ) . is ( ':checked' ) ) { formatCatalog ( "catalog-3" ) ; array [ "catalog-3" ] . results = [ ] for ( i = 0 ; i < array [ "catalog-3" ] . data . length ; i ++ ) { array . events . push ( { "action" : "Blog Catalog Update" , "itemAction" : "View Item" , "debug" : { "explanations" : true } , "flags" : { "noCampaigns" : true , "pageView" : true } , "source" : { "channel" : "Demo Builder" , "local" : "enGB" } , "user" : { "id" : "bot@ukisolutions.com" } , "catalog" : { "Blog" : array [ "catalog-3" ] . data [ i ] } } ) ; } } console . log ( array ) ; }
Function to validate each catalog type based on default settings
Function to validate each catalog type based on default settings