Skip to content

95. Eksport Danych - backup i analiza

Poziom: Sredni | Czas: 6 min

Eksport danych = safety net + advanced analytics. GHL swietny, ale sometimes potrzebujesz danych NA ZEWNATRZ (Excel, Google Sheets, accounting software, BI tools).

Dlaczego exportować?

PRZYPADKI UZYCIA:

1. BACKUP:
   GHL down? Masz kopie wszystkich kontaktów!
   
2. COMPLIANCE:
   RODO data request от klienta
   
3. MIGRATION:
   Moving з GHL -> Inna platforma
   
4. ADVANCED ANALYSIS:
   Excel pivot tables, Python/R scripts, custom charts
   
5. ACCOUNTING:
   Import transakcji do QuickBooks/Xero
   
6. REPORTING:
   Custom branded reports w PowerPoint/PDF

7. THIRD-PARTY TOOLS:
   CRM upgrade, BI tools (Tableau, Power BI)

GHL Export Formats

1. CSV Export (naj bardziej universal)

GDZIE:
Contacts -> Select All (lub filter) -> Export -> CSV

ZAWIERA:
- All contact fields (first name, email, phone, tags, etc.)
- Custom fields
- Pipeline/stage info
- Created/updated dates

FILE: contacts_export_2024-03-15.csv

OPEN w:
- Excel
- Google Sheets
- Database import tools
- Python/R (pandas, tidyverse)

2. Excel Export (Native Excel)

CONTACTS -> Export -> Excel (.xlsx)

ADVANTAGES vs CSV:
- Multiple sheets possible
- Formatting preserved
- Formulas work
- Easier для non-technical users

USE CASE:
Send leadership Excel spreadsheet (wyglada professional!)

3. API Export (Programmmatycznie)

DLA DEVELOPERS:

GHL API endpoint:
GET /contacts/
Authorization: Bearer YOUR_API_KEY

RESPONSE (JSON):
{
  "contacts": [
    {
      "id": "abc123",
      "firstName": "Jan",
      "email": "jan@example.com",
      "phone": "+48123456789",
      "tags": ["lead", "webinar-attendee"],
      "customFields": {...}
    },
    ...
  ]
}

USE CASES:
- Automated daily exports
- Real-time sync z external DB
- Custom integrations

Co exportować?

1. Contacts (Comprehensive Backup)

FILTRY (opcjonalne):

ALL CONTACTS:
- Full database dump (moze byc GB!)

SPECIFIC SEGMENT:
- Tag = "paying-customer"
- Created Date = Last 30 days
- Lead Source = "Google Ads"

FIELDS:
☑ Basic (name, email, phone)
☑ Tags
☑ Custom Fields
☑ Pipeline / Stage
☑ Created/Updated dates
☑ Last activity
☑ Assigned user

SELECT co naprawde potrzebujesz (smaller file!)

2. Opportunities (Deals Data)

REPORTING -> Opportunities -> Export

ZAWIERA:
- Deal name
- Contact linked
- Deal value
- Stage
- Probability
- Close date
- Won/Lost status

USE CASE:
Financial reporting, sales forecasting

3. Appointments (Calendar Data)

Calendars -> [Your Calendar] -> Export

FORMAT: CSV lub iCal (.ics)

DANE:
- Appointm

ent type
- Date/time
- Duration
- Contact info
- Status (booked, showed, no-show, cancelled)

USE CASE:
- Import innemu calendar (Google, Outlook)
- Time tracking / billing

4. Transactions (Revenue Data)

IF using GHL Payments:

Payments -> Transactions -> Export

CONTAINS:
- Transaction ID
- Amount
- Currency
- Payment method
- Date
- Customer info
- Product/service

USE CASE:
Accounting (import do QuickBooks), tax reporting

5. Email/SMS Logs

Marketing -> Email Campaigns -> [Campaign] -> Export Analytics

OR

Reporting -> Messaging -> Export

DANE:
- Sent count
- Delivered
- Opened
- Clicked
- Bounced
- Unsubscribed

USE CASE:
Deliverability analysis, engagement trends

Scheduling Automated Exports

GHL NIE ma natywnego scheduled export, ALE:

SOLUTION 1: Zapier

Trigger: "Every Monday @ 8 AM"
Action: "Export GHL Contacts" (via API)
Action: "Upload του Google Drive"
Result: Auto-backup tygodniowo!

SOLUTION 2: Make.com (Integromat)

Scenario:
1. Schedule: Daily @ 2 AM
2. GHL API: Get all new contacts (last 24h)
3. Google Sheets: Append rows
4. Email: Send notification "Daily backup complete"

SOLUTION 3: Custom Script (Python)

```python
import requests
import schedule
import time

def export_contacts():
    url = "https://api.gohighlevel.com/v1/contacts/"
    headers = {"Authorization": "Bearer YOUR_API_KEY"}
    response = requests.get(url, headers=headers)
    
    with open(f"contacts_backup_{time.strftime('%Y%m%d')}.json", "w") as file:
        file.write(response.text)
    
    print("Backup complete!")

schedule.every().monday.at("08:00").do(export_contacts)

while True:
    schedule.run_pending()
    time.sleep(60)

Run на server -> Auto-exports!


## Importing Exported Data

### Import dо Excel/Google Sheets:

EXCEL:

  1. Open Excel
  2. Data -> From Text/CSV
  3. Select exported .csv
  4. Click Import
  5. Adjust column formatting (dates, phone numbers)

GOOGLE SHEETS:

  1. File -> Import
  2. Upload -> Select .csv file
  3. Import Location: New sheet
  4. Delimiter: Comma
  5. Import data

FORMATTING TIPS:

  • Phone numbers: Format as "Text" (иначе Excel removes leading zeros!)
  • Dates: Format як Date (not General)
  • Emails: Text format

### Import do Other CRM:

MIGRATION SCENARIO: GHL -> Salesforce/HubSpot/Pipedrive

STEPS:

  1. Export από GHL (CSV)
  2. CLEAN DATA:
    • Remove duplicates
    • Validate emails (NeverBounce)
    • Format phone numbers (consistent format)
  3. MAP FIELDS: GHL "firstName" -> Salesforce "First Name" GHL "tags" -> Salesforce "Tags" (или custom field)
  4. TARGET CRM: Import -> Upload CSV -> Map fields -> Import

TEST με small batch (100 contacts) PRZED full import!


## Data Cleaning Pre-Export

PRZED exportem, CLEAN UP:

  1. REMOVE DUPLICATES: Contacts -> Tools -> Find Duplicates -> Merge

  2. DELETE UNQUALIFIED: Tag = "spam" -> Bulk delete

  3. VERIFY EMAILS: Run validation (NeverBounce) -> Remove invalids

  4. FORMAT CONSISTENCY: Phone numbers: +48123456789 (standardize) Country: "Poland" (не "PL", "Polska", etc.)

  5. COMPLETE MISSING DATA: Find contacts БEЗЯ email -> Delete OR manually retrieve

CLEAN DATA = ЛАGELEGHEIDSRENDE exports!


## RODO Compliance (Data Export Rights)

EU RODO Article 20: "Right to Data Portability"

CUSTOMER REQUEST: "I want copy wszystkich moich danych"

YOUR RESPONSE (30 days):

  1. GHL: Search contact по email
  2. Export SAMY ten contact (CSV)
  3. Custom Report: ALL activity (emails, SMS, calls, forms, purchases)
  4. COMPILE:
    • Contact info
    • Communication history
    • Transaction history
    • Consent records
  5. DELIVER:
    • Secured email link OR
    • Encrypted ZIP file

STRUCTURED, MACHINE-READABLE format wymagany!


## Backup Strategy

RECOMMENDED:

DAILY:

  • Incremental backup (new/updated contacts last 24h)
  • Store w cloud (Google Drive, Dropbox, S3)

WEEKLY:

  • Full database export (contacts + opportunities)
  • Local storage + Cloud

MONTHLY:

  • Archive (ZIP + Password protect)
  • Multiple locations (3-2-1 rule: 3 copies, 2 media types, 1 offsite)

ANNUAL:

  • Long-term archive
  • Delete old unnecessary data (RODO retention limits!)

AUTOMATION: Zapier/Make.com dla hands-off backups


## Advanced: Database Import (MySQL/PostgreSQL)

DLA DEVELOPERS:

EXPORT FROM GHL (CSV): contacts_export.csv

IMPORT DO DATABASE:

sql
-- Create table
CREATE TABLE contacts (
    id VARCHAR(50) PRIMARY KEY,
    first_name VARCHAR(100),
    last_name VARCHAR(100),
    email VARCHAR(255),
    phone VARCHAR(50),
    tags TEXT,
    created_at TIMESTAMP
);

-- Import CSV (PostgreSQL example)
COPY contacts(id, first_name, last_name, email, phone, tags, created_at)
FROM '/path/to/contacts_export.csv'
DELIMITER ','
CSV HEADER;

-- Query examples
SELECT COUNT(*) FROM contacts WHERE tags LIKE '%paying-customer%';
SELECT DATE(created_at), COUNT(*) FROM contacts GROUP BY DATE(created_at);

USE CASE:

  • Advanced analytics (complex SQL queries)
  • Integration με proprietary systems
  • Data science (machine learning, predictions)

## Export Limits & Performance

GHL LIMITS:

STANDARD EXPORT:

  • Max 50,000 contacts per export
  • IF więcej -> Split na multiple exports

API LIMITS:

  • Rate limit: 100 requests/min
  • Pagination: 100 contacts per page

LARGE EXPORTS (100K+ contacts):

  • Export overnight (moze take hours)
  • Use API με pagination (automated script)
  • Consider incremental exports (nie all at once)

TIP: Export tylko needed fields (szybszy, mniejszy plik)


## Common Issues

PROBLEM: "CSV otwiera się z scrambled text" FIX: Encoding issue. Open με UTF-8: Excel -> Data -> From Text -> Encoding = UTF-8

PROBLEM: "Phone numbers pokazują scientific notation (1.23E+11)" FIX: Format column як "Text" PRZED importem

PROBLEM: "Dates wrong (MM/DD zamiast DD/MM)" FIX: Excel date format settings (Region-specific)

PROBLEM: "Export button greyed out" FIX: Insufficient permissions. Check su role → Contact admin

PROBLEM: "Export file empty" FIX: Filters ta restrictive OR no data w date range selected


## Checklist

☑ Export schedule zdefiniowany (daily/weekly/monthly) ☑ Backup location (Google Drive, Dropbox, local, etc.) ☑ Automation ustawione (Zapier/Make/Script dla hands-off) ☑ Data cleaning pre-export (duplicates, invalids removed) ☑ Test restore (verify backups actually work!) ☑ RODO compliance (data retention policy, customer requests) ☑ Encryption (IF sensitive data, password-protect files) ☑ Multiple backup locations (3-2-1 rule) ☑ Access permissions (kто może exportować? Ograничi!) ☑ Documentation (co, kiedy, gdzie backups saved) ☑ Test import (verify exported data imports correctly elsewhere) ☑ Monitor export logs (errors? missing data?)


---

**Gratulacje! Ukończyłeś sekcję Raporty i Analityka (91-95).**

**Następny krok:** [96. Custom Webhooks](../zaawansowane-integracje/96-custom-webhooks.md)