🍎
Comprehensive Technical Tutorial for AEP
  • Comprehensive Technical Tutorial for Adobe Experience Platform
    • Architecture
    • Video Overview
  • 0 - Getting started
    • 0.0 Which environment do I use?
    • (Deprecated) Install the Chrome extension for the Experience League documentation
    • 0.1 Use Demo System Next to setup your Adobe Experience Platform Data Collection client property
    • 0.2 Create your Datastream
    • 0.3 Set up the website
    • 0.4 Set up the mobile app
    • 0.5 Ingest Data to AEP through the Website
    • 0.6 Ingest Data to AEP through the Mobile App
    • 0.7 Visualize your own Real-time Customer Profile - UI
    • 0.8 See your Real-time Customer Profile in action in the Call Center
    • 0.9 Set up and use the AEP API to visualize your Real-Time Customer Profile
    • 0.10 Install the Experience Platform Debugger Extension
    • 0.11 What if I want to demonstrate basic AEP concepts directly on a live website?
  • 1 - Adobe Experience Platform Data Collection and the Web SDK extension
    • 1.1 Understanding Adobe Experience Platform Data Collection
    • 1.2 Edge Network, Datastreams and Server Side Data Collection
    • 1.3 Introduction to Adobe Experience Platform Data Collection
    • 1.4 Client-side Web Data Collection
    • 1.5 Implement Adobe Analytics and Adobe Audience Manager
    • 1.6 Implement Adobe Target
    • 1.7 XDM Schema requirements in Adobe Experience Platform
    • Summary and Benefits
  • 2 - Data Ingestion
    • 2.1 Explore the Website
    • 2.2 Configure Schemas and Set Identifiers
    • 2.3 Configure Datasets
    • 2.4 Data Ingestion from Offline Sources
    • 2.5 Data Landing Zone
    • Summary and Benefits
  • 3 - Real-time Customer Profile
    • 3.1 Visit the website
    • 3.2 Visualize your own real-time customer profile - UI
    • 3.3 Visualize your own real-time customer profile - API
    • 3.4 Create a segment - UI
    • 3.5 Create a segment - API
    • 3.6 See your Real-time Customer Profile in action in the Call Center
    • Summary and benefits
  • 4 - Query Service
    • 4.0 Prerequisites
    • 4.1 Getting Started
    • 4.2 Using the Query Service
    • 4.3 Queries, queries, queries... and churn analysis
    • 4.4 Generate a dataset from a query
    • 4.5 Query Service and Power BI
    • 4.6 Query Service and Tableau
    • 4.7 Query Service API
    • Summary and benefits
  • 5 - Intelligent Services
    • 5.1 Customer AI - Data Preparation (Ingest)
    • 5.2 Customer AI - Create a New Instance (Configure)
    • 5.3 Customer AI - Scoring Dashboard and Segmentation (Predict & Take Action)
  • 6 - Real-time CDP - Build a segment and take action
    • 6.1 Create a segment
    • 6.2 Review how to configure DV360 Destination using Destinations
    • 6.3 Take Action: send your segment to DV360
    • 6.4 Take Action: send your segment to an S3-destination
    • 6.5 Take Action: send your segment to Adobe Target
    • 6.6 External Audiences
    • 6.7 Destinations SDK
    • Summary and benefits
  • 7 - Adobe Journey Optimizer: Orchestration
    • 7.1 Create your event
    • 7.2 Create your journey and email message
    • 7.3 Update your Data Collection property and test your journey
    • Summary and benefits
  • 8 - Adobe Journey Optimizer: External data sources and custom actions
    • 8.1 Define an event
    • 8.2 Define an external data source
    • 8.3 Define a custom action
    • 8.4 Create your journey and messages
    • 8.5 Trigger your journey
    • Summary and benefits
  • 9 - Adobe Journey Optimizer: Offer Decisioning
    • 9.1 Offer Decisioning 101
    • 9.2 Configure your offers and decision
    • 9.3 Prepare your Data Collection Client property and Web SDK setup for Offer Decisioning
    • 9.4 Combine Adobe Target and Offer Decisioning
    • 9.5 Use your decision in an email
    • 9.6 Test your decision using the API
    • Summary and benefits
  • 10 - Adobe Journey Optimizer: Event-based Journeys
    • 10.1 Configure an event-based journey - Order Confirmation
    • 10.2 Configure a batch-based newsletter journey
    • 10.3 Apply personalization in an email message
    • 10.4 Setup and use push notifications
    • 10.5 Create a business event journey
    • Summary and benefits
  • 11 - Customer Journey Analytics - Build a dashboard using Analysis Workspace on top of Adobe Experie
    • 11.1 Customer Journey Analytics 101
    • 11.2 Connect Adobe Experience Platform Data Sets in Customer Journey Analytics
    • 11.3 Create a Data View
    • 11.4 Data Preparation in Customer Journey Analytics
    • 11.5 Visualization using Customer Journey Analytics
    • Summary and benefits
  • 12 - Ingest & Analyze Google Analytics data in Adobe Experience Platform with the BigQuery Source Co
    • 12.1 Create your Google Cloud Platform Account
    • 12.2 Create your first query in BigQuery
    • 12.3 Connect GCP & BigQuery to Adobe Experience Platform
    • 12.4 Load data from BigQuery into Adobe Experience Platform
    • 12.5 Analyze Google Analytics Data using Customer Journey Analytics
    • Summary and benefits
  • 13 - Real-Time CDP: Segment Activation to Microsoft Azure Event Hub
    • 13.1 Configure your Microsoft Azure EventHub environment
    • 13.2 Configure your Azure Event Hub Destination in Adobe Experience Platform
    • 13.3 Create a segment
    • 13.4 Activate segment
    • 13.5 Create your Microsoft Azure Project
    • 13.6 End-to-end scenario
    • Summary and benefits
  • 14 - Real-Time CDP Connections: Event Forwarding
    • 14.1 Create a Data Collection Event Forwarding property
    • 14.2 Update your Datastream to make data available to your Data Collection Event Forwarding property
    • 14.3 Create and configure a custom webhook
    • 14.4 Create and configure a Google Cloud Function
    • 14.5 Forward events towards the AWS ecosystem
    • Summary and benefits
  • 15 - Stream data from Apache Kafka into Adobe Experience Platform
    • 15.1 Introduction to Apache Kafka
    • 15.2 Install and configure your Kafka cluster
    • 15.3 Configure HTTP API Streaming endpoint in Adobe Experience Platform
    • 15.4 Install and configure Kafka Connect and the Adobe Experience Platform Sink Connector
    • Summary and benefits
Powered by GitBook
On this page
  • Objectives
  • Context
  • 12.2.1 Create a dataset to save new BigQuery Tables
  • 12.2.2 Create your first SQL BigQuery
  • 12.2.3 Save the results of your BigQuery SQL query
  1. 12 - Ingest & Analyze Google Analytics data in Adobe Experience Platform with the BigQuery Source Co

12.2 Create your first query in BigQuery

Ingest & Analyze Google Analytics data in Adobe Experience Platform with the BigQuery Source Connector - Create your first query in BigQuery

Previous12.1 Create your Google Cloud Platform AccountNext12.3 Connect GCP & BigQuery to Adobe Experience Platform

Last updated 2 years ago

Objectives

  • Explore the BigQuery UI

  • Create a SQL query within BigQuery

  • Save your SQL query's results in a dataset within BigQuery

Context

When Google Analytics data is in BigQuery, dimensions, metrics and other variables are all nested. Also, Google Analytics data is loaded daily into different tables. This means that trying to connect Google Analytics tables within BigQuery to Adobe Experience Platform directly is very hard and not a good idea.

The solution to this problem is to transform Google Analytics data into a readable format to make the ingestion into Adobe Experience Platform easier.

12.2.1 Create a dataset to save new BigQuery Tables

Go to the BigQuery Console.

In Explorer, you'll see your Project ID. Click your Project ID (don't click on the bigquery-public-data dataset).

You can see that there isn't a dataset yet, so let's create one now. Click CREATE DATASET.

On the right side of your screen, you'll see the Create dataset menu.

For the Dataset ID, use the below naming convention. For the other fields, please leave the default settings.

Naming
Example

--demoProfileLdap--_BigQueryDataSets

vangeluw_BigQueryDataSets

Next, click Create dataset.

You'll then be back in the BigQuery Console with your dataset created.

12.2.2 Create your first SQL BigQuery

Next, you'll create your first query in BigQuery. The goal of this query is to take the Google Analytics sample data and transform it so that it can be ingested in Adobe Experience Platform. Go to the EDITOR tab.

Please copy the following SQL query and paste it into that Query Editor. Feel free to read the query and understand the Google Analytics BigQuery syntax.

SELECT
  CONCAT(fullVisitorId, CAST(hitTime AS String), '-', hitNumber) AS _id,
  TIMESTAMP(DATETIME(Year_Current, Month_Current, Day_Current, Hour, Minutes, Seconds)) AS timeStamp,
  fullVisitorId as GA_ID,
  -- Fake CUSTOMER ID
  CONCAT('3E-D4-',fullVisitorId, '-1W-93F' ) as customerID,
  Page,
  Landing_Page,
  Exit_Page,
  Device,
  Browser,
  MarketingChannel,
  TrafficSource,
  TrafficMedium,
  -- Enhanced Ecommerce
  TransactionID,
  CASE
      WHEN EcommerceActionType = '2' THEN 'Product_Detail_Views'
      WHEN EcommerceActionType = '3' THEN 'Adds_To_Cart'
      WHEN EcommerceActionType = '4' THEN 'Product_Removes_From_Cart'
      WHEN EcommerceActionType = '5' THEN 'Product_Checkouts'
      WHEN EcommerceActionType = '6' THEN 'Product_Refunds'
    ELSE
    NULL
  END
     AS Ecommerce_Action_Type,
  -- Entrances (metric)
  SUM(CASE
      WHEN isEntrance = TRUE THEN 1
    ELSE
    0
  END
    ) AS Entries,
    
--Pageviews (metric)
    COUNT(*) AS Pageviews,
    
 -- Exits 
    SUM(
    IF
      (isExit IS NOT NULL,
        1,
        0)) AS Exits,
        
 --Bounces
   SUM(CASE
      WHEN isExit = TRUE AND isEntrance = TRUE THEN 1
    ELSE
    0
  END
    ) AS Bounces,
        
  -- Unique Purchases (metric)
  COUNT(DISTINCT TransactionID) AS Unique_Purchases,
  -- Product Detail Views (metric)
  COUNT(CASE
      WHEN EcommerceActionType = '2' THEN fullVisitorId
    ELSE
    NULL
  END
    ) AS Product_Detail_Views,
  -- Product Adds To Cart (metric)
  COUNT(CASE
      WHEN EcommerceActionType = '3' THEN fullVisitorId
    ELSE
    NULL
  END
    ) AS Adds_To_Cart,
  -- Product Removes From Cart (metric)
  COUNT(CASE
      WHEN EcommerceActionType = '4' THEN fullVisitorId
    ELSE
    NULL
  END
    ) AS Product_Removes_From_Cart,
  -- Product Checkouts (metric)
  COUNT(CASE
      WHEN EcommerceActionType = '5' THEN fullVisitorId
    ELSE
    NULL
  END
    ) AS Product_Checkouts,
  -- Product Refunds (metric)
  COUNT(CASE
      WHEN EcommerceActionType = '7' THEN fullVisitorId
    ELSE
    NULL
  END
    ) AS Product_Refunds
  FROM (
  SELECT
    -- Landing Page (dimension)
    CASE
      WHEN hits.isEntrance = TRUE THEN hits.page.pageTitle
    ELSE NULL
  END
    AS Landing_page,
    
        -- Exit Page (dimension)
    CASE
      WHEN hits.isExit = TRUE THEN hits.page.pageTitle
    ELSE
    NULL
  END
    AS Exit_page,
    
    hits.page.pageTitle AS Page,
    hits.isEntrance,
    hits.isExit,
    hits.hitNumber as hitNumber,
    hits.time as hitTime,
    date as Fecha,
    fullVisitorId,
    visitStartTime,
    device.deviceCategory AS Device,
    device.browser AS Browser,
    channelGrouping AS MarketingChannel,
    trafficSource.source AS TrafficSource,
    trafficSource.medium AS TrafficMedium,
    hits.transaction.transactionId AS TransactionID,
    CAST(EXTRACT(YEAR FROM CURRENT_DATE()) AS INT64) AS Year_Current,
    CAST(EXTRACT(MONTH FROM CURRENT_DATE()) AS INT64) AS Month_Current,
     CAST(EXTRACT(DAY FROM CURRENT_DATE()) AS INT64) AS Day_Current,
    CAST(EXTRACT(DAY FROM DATE_SUB(CURRENT_DATE(),INTERVAL 1 DAY)) AS INT64) AS Day_Current_Before,
    CAST(FORMAT_DATE('%Y', PARSE_DATE("%Y%m%d", date)) AS INT64) AS Year,
  CAST(FORMAT_DATE('%m', PARSE_DATE("%Y%m%d",date)) AS INT64) AS Month,
  CAST(FORMAT_DATE('%d', PARSE_DATE("%Y%m%d",date)) AS INT64) AS Day,
    CAST(EXTRACT (hour FROM TIMESTAMP_SECONDS(hits.time)) AS INT64) AS Hour,
  CAST(EXTRACT (minute FROM TIMESTAMP_SECONDS(hits.time)) AS INT64) AS Minutes,
  CAST(EXTRACT (second FROM TIMESTAMP_SECONDS(hits.time)) AS INT64) AS SecondS,
    hits.eCommerceAction.action_type AS EcommerceActionType
  
  FROM
    `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
     UNNEST(hits) AS hits
  WHERE
    _table_suffix BETWEEN '20170101'
    AND '20170331'
    AND totals.visits = 1
    AND hits.type = 'PAGE'
    )
    
GROUP BY
  1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  9,
  10,
  11,
  12,
  13,
  14
    
  ORDER BY 2 DESC

When you are ready, click Run to run the query:

Executing the query can take a couple of minutes.

Once the query has finished running, you'll see the below output in the Query results.

12.2.3 Save the results of your BigQuery SQL query

The next step is to save the output of your query by clicking the SAVE RESULTS button.

As the location for your output, select BigQuery table.

You'll then see a new popup, where your Project Name and Dataset Name are pre-populated. The dataset name should be the dataset that you created in the beginning of this exercise, with this naming convention:

Naming
Example

--demoProfileLdap--_BigQueryDataSets

vangeluw_BigQueryDataSets

You now need to enter a Table name. Please use this naming convention:

Naming
Example

--demoProfileLdap--_GAdataTableBigQuery

vangeluw_GAdataTableBigQuery

Click SAVE.

It may take some time until the data is ready in the table you've created. After a couple of minutes, refresh the browser. You should then see within your dataset the --demoProfileLdap--_GAdataTableBigquery table under Explorer inside your BigQuery project.

You con now continue with the next exercise, where you'll connect this table to Adobe Experience Platform.

demo
demo
demo
demo
demo
demo
demo
demo
demo
demo
demo
demo
demo
demo