Skip to content

Commit

Permalink
Merge pull request #205 from alphagov/Tweaks-to-Content-Data-backfill…
Browse files Browse the repository at this point in the history
…ing-page

Tweaks to Content Data backfilling page
  • Loading branch information
annecremin authored Jul 3, 2024
2 parents 71e3103 + 656c3f6 commit fd813e5
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
title: Content Data App Backfilling
title: Content Data App backfilling
weight: 1
last_reviewed_on: 2024-06-25
last_reviewed_on: 2024-06-28
review_in: 6 months
---

# Content Data App Backfilling
# Content Data App backfilling

This page contains information on checking and backfilling the Content Data app table in BigQuery.

## Data checking

Sometime you may ned to check the volume of data on a given day. This can be done by running the following query.
The following query may help you if you need to check the volume of data in the Content Data table by date.

```sql
SELECT
Expand All @@ -22,14 +24,18 @@ ORDER BY
1 DESC
```

If any dates are missing, then there is no data and it will need backfilling.
If any dates are missing, there is no data for that date and it will need backfilling.


## Backfilling

The query to backfill content data is, you will need to change the YYYYMMDD to the date you need to back. You can also change this to a `BETWEEN` or `IN` statement.
The below query will enable you to backfill the Content Data table ('GA4 dataform').
You will need to change the 'YYYYMMDD' in this query to the date you need to query and append the data for.
You can also change this to a `BETWEEN` or `IN` statement.

The data should be appended to the `govuk-content-data.ga4.GA4 dataform` table.

The data should be appended to `govuk-content-data.ga4.GA4 dataform`. Once that is done you will have to notify #govuk-platform-support that the data is ready to reimport.
Once the data has been successfully appended (it is best to check this has worked using the checking query above), you will have to notify #govuk-platform-support that the data is ready to reimport.



Expand Down Expand Up @@ -98,7 +104,7 @@ WITH
FROM
`ga4-analytics-352613.analytics_330577055.events_*`
WHERE
_table_suffix = YYYYMMDD,
_table_suffix = YYYYMMDD ),
CTE2 AS (
SELECT
the_date,
Expand Down

0 comments on commit fd813e5

Please sign in to comment.