自定义 Floodlight 变量匹配

自定义 Floodlight 变量是附加到 Floodlight 转化数据的网址参数,通过 Google Marketing Platform 产品和服务进行管理。除了使用标准参数可收集到的信息之外,您还可以使用此类变量捕获其他信息。虽然广告客户会使用自定义 Floodlight 变量传递各种信息,但在广告数据中心内只有可用于匹配的数据是相关的,例如用户 ID、外部 Cookie 或订单 ID。

重要的是,自定义 Floodlight 变量会在用户完成转化时触发。因此,自定义 Floodlight 变量匹配仅有助于解答广告问题或在发生转化的情况下构建受众群体。这些用例的示例包括但不限于:

  • “我最近投放的广告系列有没有促使我的重点产品实现增长?”
  • “我投放的广告系列带来了多少增量收入?”
  • “我想要构建由高价值用户组成的受众群体。”
  • “我想要构建一个受众群体,其中包含以切实有效的方式与我的服务互动过的用户。”

详细了解自定义 Floodlight 变量

在广告数据中心内访问自定义 Floodlight 变量

自定义 Floodlight 变量会附加到一起,并以字符串的形式存储在 adh.cm_dt_activities_attributed 表的 event.other_data 字段中。您需要使用以下正则表达式来分离各个变量,并将 u1 替换为要用于匹配的任意变量:

REGEXP_EXTRACT(event.other_data, 'u1=([^;]*)') AS u1_val

示例

覆盖面和支出

此查询衡量的是与指定广告系列相关联的覆盖面和总支出。

crm_data 使用以下架构:

字段 说明
order_id 与订单相关联的唯一标识符。
order_val 订单的价值(以浮点数表示)。
order_timestamp 与订单的完成相关联的时间戳。
/* Creates a temporary table containing user IDs and order IDs (extracted u-values)
associated with a given campaign */
WITH floodlight AS (
  SELECT user_id, event.campaign_id, REGEXP_EXTRACT(event.other_data, 'u1=([^;]*)') AS order_id
  FROM adh.cm_dt_activities_attributed
  WHERE event.other_data LIKE "%u1%" AND event.campaign_id = 31459
)

/* Creates a temporary table where each row contains an order ID, the order's value,
and the time the order was placed */
WITH crm_data AS (
  SELECT order_id, order_val, order_timestamp
  FROM `your_cloud_project.your_dataset.crm_data`
  WHERE order_timestamp > FORMAT_TIMESTAMP('%F', TIMESTAMP_MICROS('2020-01-19 03:14:59'), @time_zone)
)

/* Joins both tables on order ID, counts the number of distinct users and sums the
value of all orders */
SELECT DISTINCT(user_id) AS reach, sum(order_val) as order_val
FROM floodlight JOIN crm_data
ON (floodlight.order_id = crm_data.order_id)

之前互动过的高支出客户

此查询会构建一个受众群体,其中包含在 2020 年 8 月期间支出超过 1,000 美元且之前与您的广告互动过的客户。

crm_data 使用以下架构:

字段 说明
your_id 与客户相关联的唯一标识符。
customer_spend_aug_2020_usd 指定客户在 2020 年 8 月期间的累计支出(以浮点数表示)。
/* Creates a temporary table containing IDs you track, alongside IDs Google tracks
for the same user */
WITH floodlight AS (
  SELECT user_id, REGEXP_EXTRACT(event.other_data, 'u1=([^;]*)') AS your_id
  FROM adh.cm_dt_activities_events
  WHERE event.other_data LIKE "%u1%"
)

/* Creates a temporary table containing IDs you track for customers who spent over
$1000 in August 2020 */
WITH crm_data AS (
  SELECT your_id
  FROM `your_cloud_project.your_dataset.crm_data`
  WHERE customer_spend_aug_2020_usd > 1000
)

/* Creates a list (to be used in audience creation) of customers who spent over
$1000 in August 2020 */
SELECT user_id
FROM floodlight
JOIN crm_data ON (floodlight.your_id = crm_data.your_id)

贵宾级长途飞行旅客

此查询会构建一个受众群体,其中包含之前在广告中完成转化,且 2019 年飞行里程超过 100,000 英里或在 2019 年期间获得航空公司“贵宾”等级的客户。

airline_data 使用以下架构:

字段 说明
your_id 与客户相关联的唯一标识符。
miles_flown_2019 客户在 2019 年的总飞行里程(以整数表示)。
ye_2019_status 客户在 2019 年获得的航空公司旅客等级。
/* Creates a temporary table containing IDs you track, alongside IDs Google
tracks for the same user */
WITH floodlight AS (
  SELECT user_id, REGEXP_EXTRACT(event.other_data, 'u1=([^;]*)') AS your_id
  FROM adh.cm_dt_activities_events
  WHERE event.other_data LIKE "%u1%"
)

/* Creates a temporary table containing IDs you track for customers who either
flew over 100,000 miles with your airline in 2019, or earned elite status in
2019 */
WITH airline_data AS (
  SELECT your_id
  FROM `my_cloud_project.my_dataset.crm_data`
  WHERE miles_flown_2019 > 100000 or ye_2019_status = "elite"
)

/* Creates a list (to be used in audience creation) of customers who previously
converted on an ad and either earned elite status, or flew over 100,000 miles
in 2019 */
SELECT user_id
FROM floodlight
JOIN airline_data ON (floodlight.your_id = airline_data.your_id)