diff --git a/organic-search-analytics/inc/code/wmtimport.php b/organic-search-analytics/inc/code/wmtimport.php index 854f5e9..468bdbe 100644 --- a/organic-search-analytics/inc/code/wmtimport.php +++ b/organic-search-analytics/inc/code/wmtimport.php @@ -58,6 +58,7 @@ public function getDataFromReportName($fileName) * @returns Int Count of records imported */ public function importGoogleSearchAnalytics($domain, $date, $searchType, $searchAnalytics) { + echo "

Import data for search type: ".$searchType."

"; $countImport = 0; foreach( $searchAnalytics->rows as $recordKey => $recordData ) { /* Prep data */ @@ -68,10 +69,24 @@ public function importGoogleSearchAnalytics($domain, $date, $searchType, $search $import = "INSERT into ".MySQL::DB_TABLE_SEARCH_ANALYTICS."(domain, date, search_engine, search_type, device_type, query, impressions, clicks, ctr, avg_position) values('$domain', '$date', 'google', '$searchType', '$deviceType', '{$query}','{$recordData['impressions']}','{$recordData['clicks']}','{$recordData['ctr']}','{$recordData['position']}')"; - if( $GLOBALS['db']->query($import) ) { + echo "Record #".$recordKey."
"; + echo $import."
"; + $result = $GLOBALS['db']->query($import); + var_dump($result); + echo "
"; + + if( $result ) { $countImport++; + } else { + echo "
";
+					var_dump($result);
+					echo "
"; } + + echo "----------
"; + } + echo "

Total records imported: ".$countImport."

"; return $countImport; }