Integration of Instagram Insights with BigQuery

Learn how to connect Instagram Insights to Google BigQuery using WitCloud and automatically fetch account reach and engagement, audience demographics, posts and stories of your Instagram business accounts.

Updated

Introduction

This module integrates with the Instagram Graph API, enabling you to collect statistics of your Instagram business accounts - account reach and engagement, audience demographics (age and gender), posts and stories - and store them in Google Cloud BigQuery.

Configuration guide

Follow the steps below to connect Instagram Insights with BigQuery. Once the setup is complete, your Instagram data will be transferred to your BigQuery project automatically.

Only Instagram business accounts that are linked to a Facebook Page you manage appear in the account list. Make sure the Facebook account you authorize has access to that Page.

Module setup

Go to Integrations in the menu and click Add integration.

Integrations list with the Add integration button

Select Instagram Insights from the list of available integrations.

Integration catalog filtered to Instagram Insights

Enter the Collect name, e.g., "Instagram Insights PL".

Collect name field filled in with the example name Instagram Insights PL

Authorization

If you have already authorized Instagram Insights, simply pick the existing authorization from the Select Instagram authorization drop-down and skip this step.

Click Authorize.

Authorize button next to the Select Instagram authorization field

A Facebook window opens. Log in and allow WitCloud to access: the profile, posts and insights of the Instagram accounts connected to your Pages, the list of Pages you manage, and your business portfolios. Then return to WitCloud.

Account selection

Choose the Instagram accounts you want to collect data from in Select accounts.

Select accounts drop-down open with example Instagram accounts

You can select several accounts at once - WitCloud creates a separate data collect for each one, named after the collect name and the account username, e.g. "Instagram Insights PL - demo_store".

Select accounts field with two example Instagram accounts selected

Optionally, click Show advanced settings to set the Data freshness (media) (from 4 to 12 hours) and to narrow down the Tables to collect if you don't need every table. All tables are selected by default.

Advanced settings with Data freshness (media) and Tables to collect

Click Next to continue.

Collect settings filled in with the Next button

Historical data and scheduling

In Historical Data, enter the number of days of historical data to fetch - up to 365.

Historical Data field with the number of days

Click Create to complete the configuration. A data synchronization schedule will be created automatically - see Auto workflows.

Historical Data filled in with the Create button

Done! Your Instagram data will now be synchronized with BigQuery.

Data schema

The module creates the tables below in your BigQuery dataset. Expand a table to view its full data schema.

Data schema for instagram_insights_account
Field NameModeType
dateNULLABLEDATE
idNULLABLESTRING
nameNULLABLESTRING
ig_idNULLABLESTRING
biographyNULLABLESTRING
usernameNULLABLESTRING
websiteNULLABLESTRING
followers_countNULLABLEINTEGER
accounts_engagedNULLABLEINTEGER
commentsNULLABLEINTEGER
follows_and_unfollowsNULLABLEINTEGER
likesNULLABLEINTEGER
profile_links_tapsNULLABLEINTEGER
reachNULLABLEINTEGER
repliesNULLABLEINTEGER
savesNULLABLEINTEGER
sharesNULLABLEINTEGER
total_interactionsNULLABLEINTEGER
viewsNULLABLEINTEGER
Data schema for instagram_insights_age_gender
Field NameModeType
dateNULLABLEDATE
idNULLABLESTRING
nameNULLABLESTRING
ig_idNULLABLESTRING
biographyNULLABLESTRING
usernameNULLABLESTRING
websiteNULLABLESTRING
followers_countNULLABLEINTEGER
engaged_audience_demographicsREPEATEDRECORD
engaged_audience_demographics.ageNULLABLESTRING
engaged_audience_demographics.genderNULLABLESTRING
engaged_audience_demographics.valueNULLABLEINTEGER
follower_demographicsREPEATEDRECORD
follower_demographics.ageNULLABLESTRING
follower_demographics.genderNULLABLESTRING
follower_demographics.valueNULLABLEINTEGER
Data schema for instagram_insights_media
Field NameModeType
dateNULLABLEDATE
timestampNULLABLESTRING
idNULLABLESTRING
ig_idNULLABLESTRING
captionNULLABLESTRING
media_product_typeNULLABLESTRING
media_typeNULLABLESTRING
permalinkNULLABLESTRING
usernameNULLABLESTRING
shortcodeNULLABLESTRING
reachNULLABLEINTEGER
viewsNULLABLEINTEGER
savedNULLABLEINTEGER
likesNULLABLEINTEGER
commentsNULLABLEINTEGER
sharesNULLABLEINTEGER
total_interactionsNULLABLEINTEGER
ig_reels_video_view_total_timeNULLABLEINTEGER
ig_reels_avg_watch_timeNULLABLEINTEGER
Data schema for instagram_insights_account_reach
Field NameModeType
dateNULLABLEDATE
idNULLABLESTRING
nameNULLABLESTRING
ig_idNULLABLEINTEGER
biographyNULLABLESTRING
usernameNULLABLESTRING
websiteNULLABLESTRING
comments_dayNULLABLEINTEGER
comments_post_dayNULLABLEINTEGER
likes_dayNULLABLEINTEGER
likes_ad_dayNULLABLEINTEGER
likes_post_dayNULLABLEINTEGER
saves_dayNULLABLEINTEGER
saves_reel_dayNULLABLEINTEGER
saves_ad_dayNULLABLEINTEGER
shares_dayNULLABLEINTEGER
total_interactions_dayNULLABLEINTEGER
total_interactions_ad_dayNULLABLEINTEGER
total_interactions_post_dayNULLABLEINTEGER
total_interactions_reel_dayNULLABLEINTEGER
views_dayNULLABLEINTEGER
views_default_do_not_use_dayNULLABLEINTEGER
views_post_dayNULLABLEINTEGER
views_reel_dayNULLABLEINTEGER
views_story_dayNULLABLEINTEGER
views_ad_dayNULLABLEINTEGER
views_carousel_container_dayNULLABLEINTEGER
reach_dayNULLABLEINTEGER
reach_post_dayNULLABLEINTEGER
reach_reel_dayNULLABLEINTEGER
reach_story_dayNULLABLEINTEGER
reach_ad_dayNULLABLEINTEGER
reach_carousel_container_dayNULLABLEINTEGER
reach_weekNULLABLEINTEGER
reach_profile_pic_weekNULLABLEINTEGER
reach_igtv_weekNULLABLEINTEGER
reach_post_weekNULLABLEINTEGER
reach_reel_weekNULLABLEINTEGER
reach_story_weekNULLABLEINTEGER
reach_ad_weekNULLABLEINTEGER
reach_carousel_container_weekNULLABLEINTEGER
reach_28_dNULLABLEINTEGER
reach_profile_pic_28_dNULLABLEINTEGER
reach_igtv_28_dNULLABLEINTEGER
reach_post_28_dNULLABLEINTEGER
reach_carousel_container_28_dNULLABLEINTEGER
reach_ad_28_dNULLABLEINTEGER
reach_story_28_dNULLABLEINTEGER
reach_reel_28_dNULLABLEINTEGER
Data schema for instagram_insights_stories
Field NameModeType
timestampNULLABLESTRING
idNULLABLESTRING
ig_idNULLABLESTRING
captionNULLABLESTRING
media_product_typeNULLABLESTRING
media_typeNULLABLESTRING
permalinkNULLABLESTRING
usernameNULLABLESTRING
shortcodeNULLABLESTRING
reachNULLABLEINTEGER
repliesNULLABLEINTEGER
sharesNULLABLEINTEGER
total_interactionsNULLABLEINTEGER
followsNULLABLEINTEGER
profile_visitsNULLABLEINTEGER
profile_activityNULLABLEINTEGER
navigationNULLABLEINTEGER
viewsNULLABLEINTEGER
loaded_atNULLABLETIMESTAMP