Maximizing Google Ads Success for Shopify Stores: A Comprehensive Guide on View Item Conversion Tracking
by ShahzadaAliHassan - 19th December 2023Introduction
In the dynamic world of digital marketing, tracking view item conversion actions in Google Ads plays a pivotal role in understanding customer interactions with your Shopify store. This detailed guide outlines how to write a data layer script for Google Tag Manager (GTM) to track these actions and how to integrate them with Google Ads for specific campaigns.
Importance of Tracking View Item Conversions
Tracking view item conversions is crucial for several reasons:
- Enhanced Ad Performance: It helps Google Ads to identify which products are gaining attention, enabling more targeted and effective advertising.
- Data-Driven Decisions: Understanding customer preferences and behaviors leads to more informed marketing and inventory decisions.
Step 1: Setting Up Google Tag Manager on Shopify
Verifying GTM Firing on Shopify
Before diving into conversion tracking, it's essential to ensure that GTM is firing correctly on your Shopify store:
- Access GTM Container ID: In your GTM dashboard, click on your container ID to view the head and body tracking scripts.
- Integrating Scripts on Shopify:
- Navigate to the 'Online Store' section of your Shopify dashboard.
- Go to 'Themes', click 'Actions', and then 'Edit Code'.
- Locate the
<head>
tag and paste the GTM head script. - Find the opening
<body>
tag (use Ctrl + F for convenience) and paste the GTM body script.
- Save Changes: Format the code, save the file, and verify the script’s functionality on your store.
Step 2: Writing the Data Layer Script for View Item Event
This set of code snippets is responsible for managing the initialization and population of the dataLayer
object on a Shopify website. It ensures that relevant data is accurately captured and made available for tracking and analytics purposes.
Initializing the DataLayer
To begin, we have a code snippet designed to initialize the dataLayer
array if it hasn't been initialized already. It also includes logic to identify whether the current page template corresponds to a 'product' page. If so, it triggers the rendering of a specific snippet called 'datalayer-product'.
Capturing Product Data
The primary focus of the 'datalayer-product' snippet is to capture essential product information when a user visits a product page. Here's how it works:
- It identifies and captures the current product variant.
- Constructs an
itemObject
that holds various product details. - Upon document load, it pushes this data into the
dataLayer
object.
Integrating Theme DataLayer Code
Lastly, to integrate the theme-level dataLayer code, you need to render the 'head-datalayer' snippet. Depending on your Shopify theme setup, this is where the head datalayer code typically resides. You should insert this code into the GTM Body Code section.
Steps to Implement DataLayer Code in Shopify:
-
Backup: Always start by creating a backup of your current theme.
-
Access Theme Files: Log in to your Shopify Admin, go to Online Store > Themes, and select "Edit code" from the "Actions" dropdown for your live theme.
-
Adding Head DataLayer Code: In the left sidebar, find and click on
theme.liquid
. Place the "Head DataLayer Code" snippet within the<head>
tags. -
Adding Product DataLayer Code: Create a new snippet (name it
datalayer-product.liquid
, if needed), and insert the "Product DataLayer Code" snippet into it. Save your changes. -
Integrate Theme DataLayer Code: Determine the desired location within the
<head>
tags intheme.liquid
for the "Theme DataLayer Code" snippet. Insert it accordingly. Save your changes. -
Testing: Visit a product page on your Shopify store, open the browser's developer console, and verify that the
custom_view_item
event is triggered and that thedataLayer
object contains the accurate product details.
These steps ensure that your Shopify website effectively captures and utilizes data for tracking and analytics purposes.
Step 3: Configuring Tags in Google Tag Manager for Enhanced View Item Tracking
Configuring tags in Google Tag Manager (GTM) is a crucial step in leveraging the full potential of view item conversion actions in your Shopify store's Google Ads campaigns. This detailed guide walks you through creating a custom view item event, setting up the necessary tags, and ensuring that these changes are effectively published in GTM.
Creating Custom View Item Event
Trigger Creation: Crafting the Custom View Item Event
The first step in GTM is to create a trigger that corresponds to the custom view item event. This trigger is essentially the condition that will activate the tag. For a Shopify store, this event is triggered when a potential customer views a product.
- Access GTM: Log in to your Google Tag Manager account and select the appropriate container.
- New Trigger: Click on 'Triggers' in the GTM interface, followed by 'New'.
- Trigger Configuration:
- Choose 'Custom Event' as the trigger type.
- Name your trigger descriptively, like 'View Item Trigger'.
- In the event name field, enter the event name that matches the event in your data layer script, such as 'view_item'.
- Set the trigger to fire on 'All Custom Events' or define specific conditions if needed.
This process establishes a direct link between the user action on your Shopify store and the tag that will be activated in response.
Setting Up Tags: Integrating with Google Ads
After setting up the trigger, the next step is to configure the tags that will send data to Google Ads when the trigger is activated.
-
Configure Google Ads Conversion Tracking Tag:
- Go to 'Tags' in GTM and create a new tag.
- Select 'Google Ads Conversion Tracking' as the tag type.
- This tag will be responsible for sending conversion data to Google Ads every time a product view occurs.
-
Utilizing Conversion ID and Label from Google Ads:
- In Google Ads, navigate to the 'Conversions' section under 'Tools & Settings'.
- Find the conversion action created for 'custom_view_item' and note the conversion ID and label.
- Back in GTM, input these details into the corresponding fields in the tag configuration.
-
Define Conversion Values Based on Product Price and Currency from the Data Layer:
- This step involves mapping the product price and currency to the conversion value.
- Use the 'Variable' feature in GTM to create new variables that pull product price and currency data from the data layer.
- Assign these variables to the conversion value and currency fields in the tag setup.
- This ensures that each view item event carries its unique value, reflecting the actual product viewed.
Publishing Changes in GTM: Activating Your Configuration
The final step in this process is to ensure that all changes made in GTM are saved and published. This action makes your configurations live, allowing data to flow from your Shopify store to Google Ads.
-
Save Your Work:
- After configuring your tags and triggers, click 'Save' on each configuration panel.
- Review all settings to ensure accuracy.
-
Publishing the Container:
- In the GTM interface, navigate to the 'Submit' button at the top right corner.
- This step opens a new window where you can name the version of the container you're publishing. For instance, 'View Item Event Tracking'.
- Optionally, add a description to document the changes made in this version.
- Click 'Publish' to make your configurations active.
-
Verify Implementation:
- Post-publishing, it's vital to verify that the tags are firing correctly.
- Use GTM's 'Preview' mode to test the tag firing on your Shopify store.
- Visit a product page on your store and check if the 'custom_view_item' event is triggering the tag.
- You can also use tools like Google Tag Assistant to verify the tag's functionality.
Step 4: Creating Conversion Actions in Google Ads
Creating conversion actions in Google Ads is a crucial step in the process of tracking and enhancing the effectiveness of your online advertising. This step involves a detailed setup within Google Ads and integration with Google Tag Manager (GTM) to ensure accurate tracking of user interactions with your Shopify store. Let’s delve deeper into each aspect of this process.
Setting Up Conversion Action
1. Navigating to Google Ads
- Accessing Conversion Actions: Begin by logging into your Google Ads account. Navigate to the 'Tools & Settings' icon. Under the 'Measurement' section, click on 'Conversions'. This area is crucial as it gives you insights into how your ads are contributing to valuable customer activity.
- Understanding Conversion Tracking: Conversion tracking in Google Ads is a powerful tool that allows you to see what happens after a customer interacts with your ads. Whether they purchase a product, sign up for a newsletter, or fill out a contact form, tracking these actions helps you understand the impact of your ads.
2. Creating a New Conversion Action
- Initiating the Process: In the 'Conversions' section, click on the plus button to create a new conversion action. This is the first step in tailoring your tracking to your specific needs.
- Selecting the Conversion Source: You will be prompted to choose the source of your conversions. Select 'Website' to track actions on your Shopify store. This tells Google Ads where to expect conversion actions to occur.
- Inputting Your Website URL: Enter the URL of your Shopify store. This step is crucial as it links your Google Ads account to your website, enabling the tracking of user interactions directly related to your ads.
3. Custom Event Setup
- Choosing Manual Action: Opt for a manual setup of the conversion action. This gives you greater control and customization over the tracking process.
- Defining the Conversion Action: Categorize your conversion action under 'Other'. This category is used for tracking actions that don’t fit into the standard options like 'Purchase' or 'Sign-up'.
- Naming the Conversion Event: Name your conversion event, such as 'View Item', to clearly identify it in your reports. Choose a name that is descriptive and aligns with the action you are tracking.
4. Conversion Value and Count Settings
- Assigning Value to Each Conversion: Determine the value of each conversion action. This could be a fixed amount or a variable value based on the product viewed. Accurately assigning value is key to understanding the return on investment (ROI) of your ads.
- Deciding on Count Frequency: Choose how often to count conversions. 'Every' counts all conversions after an ad interaction, while 'Unique' counts only one conversion per ad interaction. The choice depends on what’s more meaningful for your business model – multiple interactions or unique engagements.
Integrating with Google Tag Manager
1. Obtaining Conversion ID and Label from Google Ads
- Locating Conversion ID and Label: After setting up the conversion action in Google Ads, you'll receive a unique Conversion ID and Label. These are critical for linking your conversion tracking with GTM.
- Importance of ID and Label: The Conversion ID connects your GTM to your Google Ads account, while the Label identifies the specific conversion action you’ve set up. Together, they ensure that the data sent from GTM is accurately reflected in your Google Ads reporting.
2. Tag Configuration in GTM
- Creating a New Tag in GTM: In your GTM account, create a new tag specifically for this conversion action. Navigate to 'Tags' and click on 'New' to start this process.
- Setting Up Tag Type: Choose 'Google Ads Conversion Tracking' as the tag type. This option is specifically designed to send conversion data to Google Ads.
- Inputting Conversion Details: Enter the Conversion ID and Label that you obtained from Google Ads. This links the tag directly to your specific conversion action.
- Defining Trigger for the Tag: Set up a trigger that fires this tag whenever the 'custom_view_item' event occurs on your Shopify store. This ensures that every time a user views an item – an action you've defined as valuable – the information is sent to Google Ads.
- Adding Conversion Value and Currency: Input the conversion value and currency code. If you’ve set up dynamic values in your conversion action, use GTM’s variable feature to pull this data directly from your website, ensuring accurate value reporting for each conversion.
Finalizing and Testing
- Saving and Publishing Changes in GTM: After configuring your tag and its trigger, save the changes and publish your container. This updates your live GTM configuration, enabling the new tracking setup.
- Testing and Verification: Use GTM’s preview mode and Google Ads' conversion tracking tools to test and verify that the conversion action is being tracked correctly. Look for the conversion action in your Google Ads account to confirm it's recording data as expected.
Step 5: Applying Conversion Actions to Specific Campaigns
In the realm of digital advertising, the integration of conversion actions into specific campaigns is a critical step for enhancing the effectiveness of your Google Ads strategy. This section delves deeply into the process of linking your meticulously crafted conversion actions, specifically the 'custom_view_item' action, to your individual campaigns within Google Ads.
Linking to Campaigns
1. Verify Conversion Action in Google Ads
Before integrating the conversion actions with your campaigns, it’s paramount to ensure that these actions are correctly set up and recognized by Google Ads.
- Checking Conversion Action Status: Go to the 'Conversions' section in your Google Ads account. Here, under the 'Other' category, look for your newly created conversion action named 'custom_view_item' or the name you assigned.
- Understanding Conversion Status: The status should be 'Active', indicating that Google Ads recognizes the conversion action. If it’s not active, you might need to troubleshoot by checking if the tag in Google Tag Manager is firing correctly or if there are any discrepancies in the setup.
- Importance of Active Status: An active status is crucial because it means that Google Ads is now ready to record and analyze data related to this specific conversion action. This data is vital for optimizing your campaigns based on user interactions with your Shopify store products.
2. Assigning to Campaigns
Once the conversion action is verified and active, the next step is to assign this action to specific campaigns in your Google Ads account.
-
Selecting the Desired Campaign: In your Google Ads dashboard, navigate to the 'Campaigns' section. Here, choose the campaign you wish to optimize with the view item conversion action. It’s essential to select campaigns that align with the objectives of the conversion action. For example, if the conversion action is related to viewing a specific category of products, it should be linked to campaigns targeting similar audiences or products.
-
Campaign Settings Adjustment: Within the chosen campaign, go to the 'Settings' tab. This area allows you to modify various aspects of your campaign, including the goals and objectives.
-
Integrating Conversion Action under Goals: Scroll down to find the 'Goals' section. Here, you will see an option to link conversion actions to the campaign. It’s important to understand that linking the correct conversion action to the campaign aligns the campaign’s objectives with the actions you deem valuable, such as viewing items in your case.
-
Customization of Conversion Actions for Campaigns: Depending on the campaign’s nature and goals, you might want to link different conversion actions. For instance, for a campaign aimed at generating awareness, linking view item conversions would be appropriate. Conversely, for a campaign focused on sales, linking purchase-related conversions would be more suitable.
-
Saving the Changes: After selecting the 'custom_view_item' conversion action (or any other relevant action), save your changes. This action ensures that moving forward, the campaign's performance will be evaluated against the conversion action you've set, providing valuable insights into user behavior and campaign effectiveness.
Conclusion
By following these steps, you’ll successfully track view item conversions in your Shopify store. This enables better-targeted campaigns and more efficient ad spending in Google Ads. Remember, continuous monitoring and tweaking are essential for optimal performance. Keep learning and evolving your strategies for the best results in your e-commerce journey.