Custom variables let you pass additional data to Google Ads beyond standard conversion tracking. This data helps you build more precise audiences, optimize bids based on user attributes, and gain deeper insights into campaign performance.
While Google Ads tracks clicks and conversions by default, custom variables let you add context - customer type, cart value, product category, lead score, or any attribute relevant to your business.
This guide explains how to set up, track, and activate custom variables in Google Ads.
What Are Custom Variables in Google Ads?
Custom variables are additional data points you send alongside your Google Ads tags. They provide context about the user or transaction that Google Ads does not capture automatically.
There are several types of custom data you can pass to Google Ads:
- Conversion custom variables: Data sent with conversion events
- User-provided data: Hashed email, phone, or address for Enhanced Conversions
- Audience signals: Attributes used for remarketing list segmentation
- Cart data: Product-level details for Shopping campaigns
Each type serves a different purpose, but all follow the same principle: enriching Google Ads data with information from your website or CRM.
Why Custom Variables Matter
Standard conversion tracking tells Google Ads that a conversion happened. Custom variables tell Google Ads what kind of conversion happened.
Better Bid Optimization
When you pass variables like customer lifetime value or lead quality score, Smart Bidding can learn which clicks generate the best customers - not just the most conversions.
Smarter Audience Segmentation
Custom variables let you create remarketing lists based on user behavior or attributes. Target users who viewed premium products differently than those who viewed budget options.
Deeper Reporting Insights
Segment your conversion data by custom dimensions. See which product categories, customer types, or traffic sources drive the most value.
Improved Attribution
Pass transaction IDs, order values, and product details to connect ad clicks to specific business outcomes.
Types of Custom Variables
1. Conversion Custom Variables
These are key-value pairs sent with your conversion tag. Google Ads stores them with the conversion record for reporting and optimization.
Examples:
- Customer type (new vs returning)
- Product category
- Lead source
- Subscription tier
- Store location
2. Cart Data Parameters
For ecommerce, you can send product-level details with purchases:
- Item IDs
- Item names
- Prices
- Quantities
- Discounts
This data powers Performance Max and Shopping campaign optimization.
3. Enhanced Conversions Variables
User-provided data sent in hashed form for better conversion matching:
- Email address
- Phone number
- Name
- Address
These improve attribution accuracy, especially when cookies are limited.
4. Custom Audience Parameters
Attributes used to build remarketing audiences:
- Membership status
- Purchase history
- Content preferences
- Engagement level
Setting Up Conversion Custom Variables
Step 1: Define Your Variables in Google Ads
Before sending data, create the custom variable slots in Google Ads.
- Go to Goals → Conversions → Settings
- Click Custom variables
- Click Create custom variable
- Enter a name (e.g., “customer_type”)
- Select the data type (text or number)
- Save
You can create up to 5 custom variables per account. Choose variables that genuinely impact optimization decisions.
Step 2: Push Data to the Data Layer
Your website must make the variable values available. The cleanest approach is using the data layer.
For a purchase event with custom variables:
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "TXN-12345",
value: 249.99,
currency: "USD",
items: [
{
item_id: "SKU-001",
item_name: "Wireless Headphones",
price: 249.99,
quantity: 1
}
]
},
custom_data: {
customer_type: "returning",
product_category: "electronics",
membership_tier: "gold",
lead_score: 85
}
});
</script>
The custom_data object contains your custom variables. Adjust the structure based on your needs.
Step 3: Create Data Layer Variables in GTM
In Google Tag Manager, create variables to read these values.
Go to Variables → New → Data Layer Variable.
Variable 1: Customer Type
- Name: DLV - customer_type
- Data Layer Variable Name: custom_data.customer_type
Variable 2: Product Category
- Name: DLV - product_category
- Data Layer Variable Name: custom_data.product_category
Variable 3: Membership Tier
- Name: DLV - membership_tier
- Data Layer Variable Name: custom_data.membership_tier
Variable 4: Lead Score
- Name: DLV - lead_score
- Data Layer Variable Name: custom_data.lead_score
Save all variables.
Step 4: Configure the Google Ads Conversion Tag
Open your Google Ads conversion tag in GTM.
Scroll to the Custom Variables section (you may need to expand additional options).
Map your variables:
| Variable Name (from Google Ads) | Value (GTM Variable) |
|---|---|
| customer_type | {{DLV - customer_type}} |
| product_category | {{DLV - product_category}} |
| membership_tier | {{DLV - membership_tier}} |
| lead_score | {{DLV - lead_score}} |
Save the tag.
Step 5: Test the Implementation
Use GTM Preview Mode to verify:
- Complete a test conversion
- Check that the purchase event fires
- Verify custom variable values appear in the tag
- Confirm values are not null or undefined
In Google Ads, custom variable data may take 24-48 hours to appear in reports.
Setting Up Cart Data Parameters
For ecommerce businesses, cart data provides product-level insights to Google Ads.
Required Data Structure
Your data layer must include item details:
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "TXN-67890",
value: 379.98,
currency: "USD",
items: [
{
item_id: "SKU-100",
item_name: "Running Shoes",
price: 129.99,
quantity: 1,
item_category: "Footwear",
item_brand: "SportBrand"
},
{
item_id: "SKU-200",
item_name: "Athletic Socks 3-Pack",
price: 24.99,
quantity: 2,
item_category: "Accessories",
item_brand: "SportBrand"
}
]
}
});
</script>
GTM Configuration
Create a Data Layer Variable for items:
- Name: DLV - items
- Data Layer Variable Name: ecommerce.items
In your Google Ads conversion tag, map the items array to the Items parameter.
Google Ads uses this data to:
- Report on product-level performance
- Optimize Shopping and Performance Max campaigns
- Identify cross-sell and upsell opportunities
Setting Up Enhanced Conversions Variables
Enhanced Conversions improve attribution by matching conversions using hashed user data.
Supported Variables
- Email address
- Phone number
- First name
- Last name
- Street address
- City
- Region
- Postal code
- Country
Implementation Options
Option 1: Automatic Collection
Enable Enhanced Conversions in Google Ads and let it automatically detect form fields on your conversion pages.
- Go to Goals → Conversions → Settings
- Enable Enhanced Conversions
- Select Automatic or Google Tag
Option 2: Manual Data Layer
Push user data to the data layer in hashed or unhashed form (Google hashes automatically if needed):
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "purchase",
user_data: {
email: "customer@example.com",
phone_number: "+1234567890",
address: {
first_name: "John",
last_name: "Smith",
street: "123 Main St",
city: "New York",
region: "NY",
postal_code: "10001",
country: "US"
}
}
});
</script>
Option 3: GTM User-Provided Data Variable
Create a User-Provided Data variable in GTM that maps to your data layer fields. Then connect it to your Google Ads tag.
Activating Custom Variables for Audiences
Custom variables enable powerful remarketing segmentation.
Creating Custom Audiences
With custom variable data flowing to Google Ads, create audiences based on those attributes:
- Go to Tools → Audience Manager
- Click Create audience
- Select Website visitors
- Add rules based on custom parameters
Example audiences:
- Users who purchased from “electronics” category
- Returning customers with membership tier “gold”
- Leads with lead score above 80
- Users who viewed products over $500
Using Audiences in Campaigns
Apply these audiences to campaigns for:
- Targeting: Show ads only to specific segments
- Observation: Monitor performance without restricting reach
- Bid adjustments: Increase bids for high-value segments
- Exclusions: Prevent showing ads to converted customers
Reporting on Custom Variables
View custom variable data in Google Ads reports.
- Go to Campaigns → Conversions
- Click the Segment icon
- Select Conversions → Conversion custom variable
You can now see conversion data broken down by your custom variable values.
Example Insights
- Which customer types generate the highest conversion value
- Which product categories have the best ROAS
- Which lead sources produce qualified leads
- How membership tiers affect purchase frequency
Best Practices
Choose Variables That Impact Decisions
Only track variables that will change how you optimize or target. Tracking everything creates noise without value.
Good variables:
- Customer lifetime value
- Product margin tier
- Lead quality score
- Customer acquisition vs retention
Weak variables:
- Browser type
- Random session data
- Values that rarely change
Keep Values Consistent
Use standardized values across your site. If customer_type is sometimes “new” and sometimes “New Customer,” Google Ads treats them as different values.
Validate Before Launch
Test thoroughly in GTM Preview Mode. Null or undefined values create data gaps that are hard to fix retroactively.
Respect Privacy
Never pass personally identifiable information in plain text through custom variables. Use Enhanced Conversions with proper hashing for user data.
Document Your Setup
Record which variables exist, what values they accept, and where the data originates. This helps troubleshooting and onboarding.
Common Issues
Variables Not Appearing in Reports
- Wait 24-48 hours for data to populate
- Verify the variable is created in Google Ads settings
- Check GTM Preview to confirm values are sent
Null or Undefined Values
- The data layer push may occur after the tag fires
- The variable name path may be incorrect
- The data may not exist on all pages
Mismatched Variable Names
- The name in GTM must match the name in Google Ads exactly
- Check for typos, spaces, and capitalization
Key Takeaway
Custom variables transform Google Ads from basic conversion counting into intelligent optimization.
By passing customer type, product category, lead score, or any relevant attribute, you give Smart Bidding the context it needs to find your best customers.
Implementation requires coordination between your website data layer, GTM configuration, and Google Ads settings. But once connected, custom variables unlock reporting insights and targeting capabilities that standard tracking cannot provide.
Start with one or two high-impact variables, validate the setup, then expand as you identify new optimization opportunities.
Related Posts
How to Set Up Call Tracking with Google Ads and Google Tag Manager
12 min read
How Claude AI Can Help You Set Up Google Ads Tracking in Google Tag Manager
11 min read
WooCommerce Google Ads Conversion Tracking via GTM Using GTM4WP
14 min read
Need Help With Your Google Ads?
I help e-commerce brands scale profitably with data-driven PPC strategies.
Get In Touch