Stuifbergen.com

Analytics & Growth Hacking

  • About
  • Contact
  • Professional Services

Find me here

  • Mastodon (social)
  • Mastodon (measure)
  • No more Twitter
You are here: Home / Blog / How to make sure your GA4 events tables do not expire

How to make sure your GA4 events tables do not expire

22 August 2023 by jules Leave a Comment

In a hurry? Scroll all the way down for SQL code generator.

When you link GA4 to BigQuery in the sandbox environment (without a credit card or billing account), it “just works”.

But.. the analytics dataset will be configured to automatically expire after 60 days, even if you have added a credit card later!

Here’s how to undo the expiry of your analytics dataset and event tables:

Step 1: Unset the expiry of your analytics_nnnn dataset

Navigate to your dataset, and click “Edit Details”.

Then, un-select the Enable table expiry box and click SAVE.

Now, all the new tables in this set will have expiry set to Never.

Step 2: alter your existing event table shards to they won’t expire

If you have 60 days of events, you need to EDIT the details of all 60 daily tables manually.

Option 1: manually click all tables. That’s a lot of clicking.

Click.. select date, click.. edit details, click… “None”, click.. SAVE.

Option 2: type an “ALTER TABLE” statement.

One per table shard:

ALTER TABLE projectname.analytics_nnnnn.events_20230725 SET OPTIONS(expiration_timestamp=null)

To speed this up, you can use this alter table shard to unset expiry generator and use the output.

  • enter your projectname
  • enter your dataset name
  • click refresh and copy the SQL statements

The following code will unset expiry for shards 62 days ago until today

Unset 60 days of expiry Project name:
Dataset name:

Refresh

Copy-paste this code into a new query and run.

Related posts:

ParisSession modeling in BigQuery SQL (using GA4 data and a trip to Paris) Using Big Query to calculate DAU / MAU Making sense of Event Parameters in GA4 Make your GA4 life easier: Some powertips!

Filed Under: Blog Tagged With: bigquery, expiry, ga4, sql, tools

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • How to use a pre-hashed email address in GA4 tags in GTM
  • GA4 intraday exports and cookieless pings
  • July 2024 change in collected_traffic_source in GA4 Big Query
  • srsltid parameter, GA4 and Big Query
  • Smart incremental GA4 tables in Dataform

Need help?

  • Contact me

Search

© Copyright Jules Stuifbergen · Powered by Genesis ·