BigQuery에 Shopify 데이터 로드

Shopify용 BigQuery Data Transfer Service 커넥터를 사용하여 Shopify에서 BigQuery로 데이터를 로드할 수 있습니다. BigQuery Data Transfer Service를 사용하면 Shopify의 최신 데이터를 BigQuery에 추가하는 반복 전송 작업을 예약할 수 있습니다.

Shopify 커넥터는 다음 리소스에서 Collections 및 Orders와 같은 GraphQL 기반 리소스의 데이터 전송을 지원합니다.

  • 구독 기반 계정
  • 파트너 계정

제한사항

Shopify 데이터 전송에는 다음과 같은 제한사항이 적용됩니다.

  • 데이터 전송에 GiftCards 객체를 포함하려면 이 데이터 전송과 연결된 계정에 ShopifyPlus 구독이 있어야 합니다.
  • 데이터 전송에 다음 앱 정기 결제 데이터 객체를 포함하려면 Shopify 스토어에 설치된 앱이 영업 채널 앱이어야 합니다.
    • AppSubscriptionLineItems
    • AppSubscriptions
    • ProductResourceFeedbacks
  • 할인 함수가 필요한 다음 Shopify 데이터 객체를 포함하려면 Shopify CLI를 사용하여 Shopify 앱을 만들어야 합니다.
    • DiscountsCodeApp
    • DiscountsCodeBasic

시작하기 전에

다음 섹션에서는 Shopify 데이터 전송을 만들기 전에 수행해야 하는 기본 요건을 설명합니다.

Shopify 기본 요건

  • Shopify 계정과 Shopify 스토어가 있어야 합니다.
  • Shopify 스토어에 커스텀 Shopify 앱이 있어야 합니다. 자세한 내용은 맞춤 앱을 참고하세요.
  • BigQuery로 전송하려는 Shopify 데이터 객체에 필요한 범위에 액세스할 수 있어야 합니다. 각 객체에 필요한 범위 목록은 지원되는 객체 및 필수 범위를 참조하세요.

BigQuery 기본 요건

필요한 BigQuery 역할

BigQuery Data Transfer Service 데이터 전송을 만드는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 BigQuery 관리자 (roles/bigquery.admin) IAM 역할을 부여해 달라고 요청하세요. 역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.

이 사전 정의된 역할에는 BigQuery Data Transfer Service 데이터 전송을 만드는 데 필요한 권한이 포함되어 있습니다. 필요한 정확한 권한을 보려면 필수 권한 섹션을 펼치세요.

필수 권한

BigQuery Data Transfer Service 데이터 전송을 만들려면 다음 권한이 필요합니다.

  • BigQuery Data Transfer Service 권한:
    • bigquery.transfers.update
    • bigquery.transfers.get
  • BigQuery 권한:
    • bigquery.datasets.get
    • bigquery.datasets.getIamPolicy
    • bigquery.datasets.update
    • bigquery.datasets.setIamPolicy
    • bigquery.jobs.create

커스텀 역할이나 다른 사전 정의된 역할을 사용하여 이 권한을 부여받을 수도 있습니다.

자세한 내용은 bigquery.admin 액세스 권한 부여를 참고하세요.

Pub/Sub의 전송 실행 알림을 설정하려면 pubsub.topics.setIamPolicy Identity and Access Management(IAM) 권한이 있어야 합니다. 이메일 알림만 설정한다면 Pub/Sub 권한이 필요하지 않습니다. 자세한 내용은 BigQuery Data Transfer Service 실행 알림을 참조하세요.

Shopify 데이터 전송 설정

다음 옵션 중 하나를 사용하여 전송 구성을 설정하여 BigQuery에 Shopify 데이터를 추가합니다.

콘솔

  1. Google Cloud 콘솔에서 데이터 전송 페이지로 이동합니다.

    데이터 전송으로 이동

  2. 전송 만들기를 클릭합니다.

  3. 소스 유형 섹션의 소스에서 Shopify를 선택합니다.

  4. 데이터 소스 세부정보 섹션에서 다음을 수행합니다.

    • Shop name(매장 이름)에 Shopify 매장 이름을 입력합니다. 예를 들어 판매자 계정 ID가 storename.myshopify.com이면 매장 이름은 storename입니다.
    • 클라이언트 ID 및 클라이언트 보안 비밀번호에 Shopify 앱의 클라이언트 ID와 보안 비밀번호를 입력합니다. 자세한 내용은 클라이언트 보안 비밀번호 정보를 참조하세요.
    • 전송할 Shopify 객체에서 찾아보기를 클릭합니다.
      • BigQuery 대상 데이터 세트로 전송할 객체를 선택합니다. 데이터 전송에 포함할 객체를 이 필드에 직접 입력할 수도 있습니다.
  5. 대상 설정 섹션의 데이터 세트에서 데이터를 저장하기 위해 만든 데이터 세트를 선택합니다.

  6. 전송 구성 이름 섹션의 표시 이름에 데이터 전송 이름을 입력합니다.

  7. 일정 옵션 섹션에서 다음을 수행합니다.

    • 반복 빈도 목록에서 이 데이터 전송 실행 빈도를 지정하는 옵션을 선택합니다. 커스텀 반복 빈도를 지정하려면 커스텀을 선택합니다. 주문형을 선택한 경우 수동으로 전송을 트리거하면 이 전송이 실행됩니다.
    • 해당하는 경우 지금 시작 또는 설정 시간에 시작을 선택하고 시작 날짜와 실행 시간을 입력합니다.
  8. 선택사항: 알림 옵션 섹션에서 다음을 수행합니다.

    • 이메일 알림을 사용 설정하려면 이메일 알림 전환 버튼을 클릭합니다. 이 옵션을 사용 설정하면 전송 실행이 실패할 때 전송 관리자에게 이메일 알림이 발송됩니다.
    • 이 전송에 Pub/Sub 전송 실행 알림을 사용 설정하려면 Pub/Sub 알림 전환 버튼을 클릭합니다. 주제 이름을 선택하거나 주제 만들기를 클릭하여 주제를 만들 수 있습니다.
  9. 저장을 클릭합니다.

bq

bq mk 명령어를 입력하고 전송 생성 플래그 --transfer_config를 지정합니다.

bq mk
    --transfer_config
    --project_id=PROJECT_ID
    --data_source=DATA_SOURCE
    --display_name=NAME
    --target_dataset=DATASET
    --params='PARAMETERS'

각 항목의 의미는 다음과 같습니다.

  • PROJECT_ID(선택사항): Google Cloud 프로젝트 ID. 특정 프로젝트를 지정하는 --project_id가 입력되지 않으면 기본 프로젝트가 사용됩니다.
  • DATA_SOURCE: 데이터 소스 — shopify
  • NAME: 데이터 전송 구성의 표시 이름. 전송 이름은 나중에 수정해야 할 경우를 대비해 간편하게 전송을 식별할 수 있는 값이면 됩니다.
  • DATASET. 전송 구성의 대상 데이터 세트
  • PARAMETERS: JSON 형식으로 생성된 전송 구성의 매개변수. 예를 들면 --params='{"param":"param_value"}'입니다. 다음은 Shopify 데이터 전송의 파라미터입니다.

    • assets: BigQuery로 전송할 Shopify 객체의 경로.
    • connector.shopName: Shopify 상점의 이름입니다. 예를 들어 판매자 계정 ID가 storename.myshopify.com인 경우 매장 이름은 storename입니다.
    • connector.authentication.accessToken: Shopify Admin API 액세스 토큰입니다.

다음 명령어는 기본 프로젝트에 Shopify 데이터 전송 증분을 만듭니다.

bq mk
    --transfer_config
    --target_dataset=mydataset
    --data_source=shopify
    --display_name='My Transfer'
    --params='{"assets": ["Orders"]
        "connector.shopName": "storename",
        "connector.authentication.accessToken":"sk_test_123456789"}'
전송 구성을 저장하면 Shopify 커넥터가 일정 옵션에 따라 전송 실행을 자동으로 트리거합니다. 전송이 실행될 때마다 Shopify 커넥터는 Shopify에서 사용 가능한 모든 데이터를 BigQuery로 전송합니다.

정기 일정 외에 데이터 전송을 수동으로 실행하려면 백필 실행을 시작하면 됩니다.

지원되는 객체 및 필수 범위

다음 표에는 BigQuery로 전송할 수 있는 Shopify 데이터 객체와 각 객체에 필요한 범위가 나와 있습니다.

데이터 객체 필수 범위
AppFeedbacks 범위 필요 없음
AppSubscriptionLineItems 범위 필요 없음
AppSubscriptions 범위 필요 없음
카탈로그 read_products 또는 read_product_listings
read_publications
컬렉션 read_products
read_publications
회사 read_customers 또는 read_companies
CompanyContactRoleAssignments read_customers 또는 read_companies
CompanyContacts read_customers 또는 read_companies
CompanyLocations read_customers 또는 read_companies
고객 read_customers
write_customers
read_customer_merge
read_locations 또는 read_inventory
read_markets
read_orders
DeliveryProfiles read_products
read_shipping
DiscountsAutomaticApp read_discounts
DiscountsAutomaticBasic read_discounts
DiscountsAutomaticBxgy read_discounts
DiscountsCodeApp read_discounts
DiscountsCodeBasic read_discounts
DiscountsCodeBxgy read_discounts
DraftOrders read_customers
read_draft_orders
read_orders
read_payment_terms
파일 read_files
FulfillmentEvents read_orders
FulfillmentOrders read_locations
read_orders
read_assigned_fulfillment_orders, read_merchant_managed_fulfillment_orders 또는 read_third_party_fulfillment_orders
fulfillment read_fulfillments 또는 read_products
read_locations
read_orders
FulfillmentServices read_locations 또는 read_inventory
read_fulfillments, read_products, read_custom_fulfillment_services 또는 assigned_fulfillment_orders
FulfillmentTrackingInfo read_fulfillments 또는 read_products
read_locations
read_orders
GiftCards read_gift_cards
read_orders
read_customers
InventoryItems read_inventory
read_products
위치 read_locations
read_fulfillments
Metafields_Article read_content
Metafields_Blog read_content
Metafields_Collection read_products
read_publications
Metafields_Customer read_customers
write_customers
read_customer_merge
read_locations 또는 read_inventory
read_markets
read_orders
Metafields_Draft_Order read_customers
read_draft_orders
read_orders
read_payment_terms
Metafields_Order read_customers
read_inventory
read_locations
read_orders
read_payment_terms
Metafields_Page read_content
Metafields_Product read_products
read_product_listings
read_publications
Metafields_Selling_Plan read_products
Metafields_Shop 범위 필요 없음
Metafields_Variant read_products
read_shipping
OrderLineItems read_orders
read_products
OrderRiskAssessments read_orders
주문 read_customers
read_inventory
read_locations
read_orders
read_payment_terms
read_draft_orders
read_products 또는 read_fulfillments
OrderTransactions read_orders
read_products
PriceLists read_products
ProductMediaImages read_products
ProductOptions read_products
ProductOptionValues read_products
ProductResourceFeedbacks read_resource_feedbacks
read_products
제품 read_products
read_product_listings
read_publications
ProductVariants read_products
read_shipping
간행물 read_products
read_publications
환불 read_products
read_orders
read_returns
반환 read_orders
read_returns
ScriptTags read_script_tags
부문 read_customers
SellingPlanGroups read_products
StorefrontAccessTokens 범위 필요 없음
UrlRedirects read_online_store_navigation

데이터 유형 매핑

다음 표는 Shopify 데이터 유형을 해당하는 BigQuery 데이터 유형에 매핑합니다.

Shopify 데이터 유형 BigQuery 데이터 유형
String STRING
Int INT64
Decimal NUMERIC
Double FLOAT64
Long BIGNUMERIC
Bool BOOL
Datetime TIMESTAMP

가격 책정

이 기능이 프리뷰 버전인 동안에는 Shopify 데이터를 BigQuery로 전송하는 데 비용이 들지 않습니다.

전송 설정 문제 해결

데이터 전송을 설정하는 데 문제가 있으면 Shopify 전송 문제를 참조하세요.

다음 단계