HockeyStack
HomeLive DemoBook a DemoLogin
  • Getting Started
    • 👋Welcome to the Docs!
    • Product Onboarding
    • HockeyStack Implementation Scope: Reporting Product
  • Release Notes
    • May 5, 2025
    • April 21, 2025
    • April 14, 2025
    • April 7, 2025
    • March 31, 2025
    • March 24, 2025
    • March 14, 2025
    • March 6, 2025
    • February 28, 2025
    • February 17, 2025
  • Guides
    • ❓FAQ
      • Merging in HockeyStack
      • Why has my data changed?
      • Viewing form submissions by page
      • A touchpoint's influence on conversion rates
      • Average number of touchpoints
      • Self-reported attribution
      • Trend of Engagement Score
      • How do I see which individuals / companies are included in a metric?
      • What touchpoints get credit in attribution?
      • What object/integration is this field pulling from?
      • What is "Source"?
      • What is "UTM Source"?
      • What is "UTM Medium"?
      • What is an Action?
      • How can I add Salesforce Task object into Defined Properties?
      • How can I track offline events in HubSpot?
      • How can I use LinkedIn Impressions and Engagements in my reports?
      • Measuring sales and marketing penetration in an account list
      • Measuring number of engaged contacts per company
      • Offline conversions for ad platforms
      • Tracking progression on targets
      • Building a Campaign / Asset Grouping property
      • Percentage of high quality job titles by Channel
      • Measuring conversion rates
      • Building a goal that shows open opportunities
      • Number report: Funnel stages influenced by different types of marketing touchpoints
      • Best Practices for Lifecycle Tracking in Salesforce / HubSpot
      • Adding HubSpot form fills to defined properties
      • Does HockeyStack website pixel track US States?
      • Measuring Time Between Two Goals in HockeyStack
      • What is the HubSpot "email bounces" action?
      • Hiding Fields from your CRM in HockeyStack
      • How long does it take for a relation mapping to be ready to use?
      • Can I integrate multiple LinkedIn ads accounts?
      • Can I use Zapier for integrations with HockeyStack?
      • I created a new field in Salesforce (SFDC), but I don’t see it in HockeyStack. What should I do?
      • Using two similar fields in one breakdown
      • Why can't I map back to property?
      • GA4 vs. HockeyStack Website Data Tracking
      • How does HockeyStack deduplicate accounts?
      • How do Table Totals Work: Campaign vs Campaign Group?
      • Can I create one field that calculates the total ad spend + SFDC campaign spend?
      • HubSpot: Can I filter a goal on X object by Y object fields?
      • LinkedIn Impressions: Different Ways of Measuring
      • How to define Engaged Accounts and Engaged People?
      • Building a Campaign Grouping property
    • 🖥️Dashboard Building Guides
      • Business Overview Dashboard
      • CMO Dashboard
      • Website Analytics Dashboard
      • Paid Ads Dashboard
      • Google Ads Dashboard
      • LinkedIn Ads Dashboard
      • In-Person Events
      • ABM Live-Demo
      • Content/Organic Dashboard
      • Dashboards from Labs Reports
        • LinkedIn Ads Benchmarks
        • Google Ads Benchmarks
        • Q1 2024 Recap
        • G2 Impact 2024 Report
        • Website Benchmarks
  • Documentation
    • The HockeyStack Data Model
    • 🎯Goals
      • Funnel Stages Goals
      • Form Fill Goals
      • Page View Goals
      • Click Goals
      • Finding Out a Button's CSS Selector
      • Goals on the Task Object
      • Building an All Touchpoints (Channel) Goal
    • Defined Properties
    • Track Date Properties
    • 📊Reports
      • Building a Basic Report
      • Journeys Use Cases
      • Customer Touchpoint Hierarchy
      • Sequences
      • Lift Reports
      • Lift Analysis vs. Multi-Touch Attribution
      • Types of report filters and when to use them
      • Attribution Models
      • Attribution Lookback
      • Defining Custom Attribution Weights
      • Importing a Google Sheet to use as a Goal Column
      • Advanced Attribution Models
    • 🖥️Dashboards
    • Dashboard Filters
      • When to use AND vs. OR logic?
      • Using Regex
    • 🌠Journeys
      • Syncing journeys to CRM and Slack
    • 🥇Golden Paths
    • Funnels
    • Attribution Funnel
    • 👥Segments
    • ⚙️Settings
      • Account Reset Guide
      • Auto-tagging of URLs
      • Data Categorization in HockeyStack
      • Team Sharing
      • Tracking Multiple Domains
      • Excluding Users
      • Reporting Configuration
      • Multi-Factor Authentication
    • Advanced Data Connections
      • Account List Import
      • Property Relation Mappings
      • Sync Spend
      • Syncing spend from offline channels and campaigns
    • 🔃Audience Syncs
    • Send View updates to Webhooks
    • Odin AI
      • HockeyStack AI: Security, Privacy, and Responsible Use
  • DataSyncs
    • Connecting your Warehouse
      • Authenticate Snowflake
      • Authenticate Google Sheets
      • Authenticate BigQuery
      • Authenticate S3
        • Use an S3 User
        • Use an IAM Role
    • Configure a DataSync Import
    • Configure a DataSync Export
      • Data Export Schema
        • Raw Actions Export Schema
  • Integrations
    • Website Tracker
      • Google Tag Manager
      • WordPress
      • React
      • Troubleshooting
      • Reverting to Cookie-Based Tracking
      • Identifying Users
      • Tracking Custom Goals
    • Ad Platforms
      • LinkedIn Ads
      • Bing Ads
      • Capterra Ads
      • Google Ads
      • Facebook Ads
      • Tiktok Ads
      • Twitter Ads
      • StackAdapt Ads
      • Reddit Ads
      • AdRoll Ads
    • Analytics & Data Warehouse
      • Snowflake
      • Amazon Redshift
      • Google Bigquery
      • Amazon S3
      • Azure Databricks
    • CRMs
      • Salesforce
        • Properties Pulled from Salesforce
        • Salesforce Pulled Objects List
        • Sending Data to Salesforce
      • HubSpot
        • HubSpot Pulled Objects List
    • SSO
      • Azure AD
      • Google Workspace
      • Okta
    • ABM
      • Qualified
      • 6sense
      • Demandbase
      • Clearbit
      • Rollworks
      • G2 Intent
      • Stackadapt
    • Marketing Automation
      • Marketo
        • How to Find Your Marketo Account Details
        • Marketo Pulled Objects List
      • Pardot
      • HubSpot
        • HubSpot Pulled Objects List
    • Other Integrations
      • Calendly
      • Drift
      • Okta
      • Segment
      • Customer.io
  • Setting up your Data for import
    • Import Custom Actions
    • Import Website Actions
    • Import Properties
    • Import Metadata
  • Technical Details
    • ↖️Website Tracking
      • How Website Tracking Works
      • Cookieless Tracking
      • Bot Traffic
      • Privacy Policy
      • GDPR Compliance
    • ⚙️Data Processing from Integrations
    • 🧮Data Cleaning
  • Account Intelligence
    • ☕Getting Started
      • HockeyStack Implementation Scope: Account Intelligence Product
      • Salesforce
        • Salesforce Permissions
        • Salesforce iFrame Installation
        • Salesforce Sync Fields
    • 🏗️Workflows
      • Creating a Workflow
      • List of Workflows
      • Starter Workflow
      • Recurring Workflow Runs
      • Nodes
        • Transformations
          • Condition
          • AI for Accounts
          • Contact Discovery
          • Contact Enrichment
          • Branching
        • Destinations
          • Salesforce
          • HubSpot
          • Outreach
          • StackAdapt
          • Salesloft
          • LinkedIn
          • Pardot
    • 👀Views
      • Create a New View
    • 🔢Scoring
      • Data
Powered by GitBook
On this page
  • Getting Started
  • What Data Gets Tracked as Metadata
  • High-Level Integration Flow
  • Tracking Lead Forms
  • Notes and Caveats
  1. Integrations
  2. Ad Platforms

Facebook Ads

With HockeyStack you can seamlessly authenticate, fetch, and analyze ad performance metrics from Facebook Ads, Campaigns, and Lead Forms

Getting Started

  1. Sign In: A Facebook login window will appear, sign in and proceed to granting permissions

  2. Grant Permissions: Review the requested permissions, such as access to your ad accounts and campaigns. Click Allow to grant the necessary permissions.

  3. Confirmation: After granting permissions, you'll be redirected back to the ad reporting platform, confirming the successful connection

What Data Gets Tracked as Metadata

The following fields are tracked and stored during the integration process:

Field

Description

account_id_hashed

A hashed version of the account ID for secure storage.

type

The type of tracked data, such as paid-ads.

date

The date of the ad activity, formatted as YYYY-MM-DD.

id

A unique identifier for each data row, generated as an MD5 hash.

metadata

A JSON object containing detailed metadata about the campaign and ad.

account_id

The original account ID associated with the ad.

network

The advertising network, such as Facebook Ads.

campaign_id

The unique ID of the campaign.

adgroup_id

The unique ID of the ad group.

ad_id

The unique ID of the ad.

campaign_name

The name of the campaign.

adgroup_name

The name of the ad group.

ad_name

The name of the ad.

utm_source

The source of the traffic, such as facebook.

utm_campaign

The campaign name, URL-encoded if necessary.

utm_medium

The medium of the traffic, such as paid.

utm_content

Content-specific identifier for the campaign.

utm_term

The keyword associated with the campaign, if applicable.

impressions

The total number of impressions for the ad.

clicks

The total number of clicks for the ad.

cost

The total cost of the ad campaign in the specified currency.

currency

The currency in which the ad costs are measured (e.g., USD).

High-Level Integration Flow

  1. Validate Integration:

    • Ensure the integration object contains required fields like facebookUserId and accessToken.

  2. Fetch Ad Accounts:

    • Retrieve ad accounts linked to the user’s facebookUserId using facebookApiRequest.

    • Handle token expiration or invalid tokens by marking the integration as expired.

  3. Retrieve Currencies:

    • Fetch account currencies using fetchAccountCurrencies.

    • Update stored currencies with the updateCurrencies function.

  4. Process Ad Accounts:

    • Iterate through all ad accounts in the integration object.

    • Skip accounts marked as paused to optimize processing.

  5. Fetch Insights and Ads:

    • Fetch ad insights (e.g., impressions, clicks, and spend) for a specific date range.

    • Retrieve associated ad data and format it for storage.

  6. Process Lead Forms:

    • Identify and process any lead forms linked to ads using fetchLeads.

    • Create lead actions from submissions and store them.

Tracking Lead Forms

The integration tracks Facebook lead form submissions and creates a "Facebook Lead Form Submit" action that can be used as part of Goal building

Action Properties Tracked:

Field

Description

facebook_lead_id

Unique identifier for the Facebook lead.

facebook_form_id

Identifier for the lead form submitted.

facebook_campaign_name

Name of the campaign associated with the lead.

facebook_campaign_id

Unique ID of the campaign.

facebook_adgroup_name

Name of the ad group associated with the lead.

facebook_adgroup_id

Unique ID of the ad group.

facebook_ad_name

Name of the ad generating the lead.

facebook_ad_id

Unique ID of the ad.

facebook_creative_name

Name of the creative asset used in the ad.

facebook_creative_id

Unique ID of the creative asset.

utm_source

Traffic source, defaulting to facebook.

utm_medium

Traffic medium, defaulting to paid.

utm_campaign

Encoded campaign name for tracking.

submitted_at

Timestamp when the lead form was submitted.

Company Properties Tracked:

Field

Description

company_name

The name of the company, if provided.

Other Properties Tracked:

Field

Description

userId

Email address of the user, derived from the lead form.

identity

Same as userId, used for identifying the user.

session_start_date

Timestamp of when the lead form submission occurred.

actionDate

JavaScript Date object representation of the lead submission time.

actionType

Always set to custom for lead forms.

actionName

Always set to Facebook Lead Form Submit.

shared

Additional metadata including submission ID and associated properties.

Notes and Caveats

  • Token Expiration:

    • Handle authentication errors (codes 190 and 102) by marking the integration as expired and prompting re-authentication.

  • Rate Limits:

    • For rate limit errors (error code 17), retry up to 3 times with exponential backoff.

  • Large Data Requests:

    • Split date ranges or reduce data volume for errors related to excessive data (error code 1).

  • Default Processing Period:

    • The integration processes the last 28 days by default, with adjustments for specific accounts as needed.

  • Batch Limits:

    • Data is processed in batches of 1000 records to optimize performance.

  • Campaign Name Tracking:

    • Track and handle changes in campaign names to ensure data consistency.

PreviousGoogle AdsNextTiktok Ads

Last updated 3 months ago