How to add Google Click ID (GCLID) to Google Analytics

What’s your strengths and weakness of your latest Google Ads campaign? Without this essential information, it’s impossible to find out which strategy works for your brand.

Website owners face challenges when tracking their Google Ads campaigns, which can lower their ability to optimize their marketing and make money.

This article will show you how to add GCLID to Google Analytics and give you instructions on how to solve this pain point and get valuable insights into your website’s performance.

On this post
    How to add Google Click ID (GCLID) to Google Analytics

    What’s GCLID?

    The GCLID, or Google Click Identifier, is an essential component for tracking your Google Ads campaigns. By using the GCLID, you can collect information and understand the behavior of people who visit your website by clicking on your ad. The GCLID is located as a long slice of code behind your URL. In fact, the click identifier doesn’t exist only at Google. There are also Facebook, Microsoft, and other versions of it—known as FBCLID and MSCLID, etc.

    To capture the GCLID in Google Analytics, you need to take some actions. In this article, we’ll talk about how to add Google Click ID (GCLID) to Google Analytics. You also have to enable GCLID tracking in your Google Ads Account.

    How to add Google Click ID (GCLID) to Google Analytics Universal

    Create new Custom Dimension on Google Analytics Universal

    Our first step is to prepare Google Analytics to collect GCLID data. For this, we need a new “Custom Dimension”. You can prepare Google Analytics to collect GCLID data by following the steps below.

    1. Visit the Google Analytics home page.
    2. Navigate to your “Admin Page” by clicking the button on the bottom left.
    3. Select your account on the left and then your property on the middle panel.
    4. Click on “Custom Definitions” and then “Custom Dimensions”.
    5. Click the “+ New Custom Dimension” button.
    6. Name your new custom dimension as “GCLID” and select “User” for scope.
    7. Click the “Create” button to create your new custom dimension.
    8. After you’ve created the Custom Dimension, look at the table of all custom dimensions and note the “Index” of the custom dimension you just created (GCLID). We’ll need to use this in the next steps.
    Creating new Custom Dimension on Google Analytics Universal.

    Create new variable on Google Tag Manager (GTM) to capture GCLID from URL

    When a user clicks on your ad, Google adds a GCLID to the end of the URL. Unfortunately, Google Analytics doesn’t collect this information by default. We need to somehow separate the GCLID from the URL and send it to Google Analytics. For this, we need the Google Tag Manager. With a variable that we’ll create in Google Tag Manager, we can easily do this and send the GCLID to Google Analytics for storage.

    1. Go to Google Tag Manager.
    2. Navigate to the “Variables” page by clicking the “Variables” button in the left sidebar.
    3. Click the “New” button on the User-Defined Variables panel.
    4. Click the “Variable Configuration” panel to configure your new variable.
    5. Choose the “URL” for variable type.
    6. Choose the “Query” for component type.
    7. Type “GCLID” for query key.
    8. Name your variable as you wish and click the “Save” button in the top right corner.
    Creating new variable on Google Tag Manager.

    After applying the above steps, Google Tag Manager can separate the GCLID from the URL to store it in a variable. Now, we just need to send this variable to Google Analytics on user visits.

    Create new Tag on Google Tag Manager to send GCLID to Google Analytics Universal

    In the previous steps, we separated the GCLID from the URL and stored it as a variable. However, this variable is still only available in Google Tag Manager, not in Google Analytics. In this step, we add a new tag to Google Tag Manager to send this variable to Google Analytics.

    If you don’t have an Analytics Tag that you use to send your data to Google Analytics Universal

    1. Navigate to the “Tags” page by clicking the “Tags” button in the left sidebar.
    2. Click “New” in the Tags panel to create a new tag.
    3. Click the “Tag Configuration” panel to configure your new tag.
    4. Select “Google Analytics: Universal Analytics” as the Tag type.
    5. Click the “Google Analytics Settings” drop-down menu and select “New Variable”.
    6. In the variable configuration, enter your “Tracking ID.”
    7. Click the “More Settings” then “Custom Dimensions”.
    8. Click on the “+ Add Custom Dimension” button.
    9. For “Index”, the index number of your custom dimension that you noted in the previous steps.
    10. For “Dimension Value”, click the plus button and choose the GTM variable you created for GCLID in the previous steps.
    11. Click “Save” to save your Variable Configuration.
    12. Click the “Triggering” panel to adjust trigger for this tag.
    13. Select “All Pages.”
    14. Name the New Tag as you wish and click “Save” to save it.
    Configuring a new tag.
    Adjusting trigger for new tag on Triggering panel.

    If you already have an Analytics Tag that you use to send your data to Google Analytics Universal

    1. Navigate to the “Tags” page by clicking the “Tags” button in the left sidebar.
    2. Click on your existing “Google Analytics: Universal Analytics” tag to configure it.
    3. Click the info icon next to your Google Analytics settings.
    4. Click the “More Settings” and then click “Custom Dimensions”.
    5. Click the “+ Add Custom Dimension” button.
    6. For “Index”, type the index number of your custom dimension that you noted in the previous steps.
    7. For “Dimension Value”, click the plus button and choose the GTM variable you created for GCLID in the previous steps.
    8. Click “Save” to save your variable configuration.
    9. Click “Save” to save changes on the Tag.

    How to add Google Click ID (GCLID) to Google Analytics 4?

    Create new custom definition on Google Analytics 4

    Our first step is to get Google Analytics 4 ready to collect GCLID data. We’ll need a new “custom definition” for this. You can get Google Analytics 4 ready to collect GCLID data by following the steps below.

    1. Visit Google Analytics home page.
    2. Navigate to your “Configure” page by clicking the button on the left panel.
    3. Click “Custom Definitions”.
    4. Click “+ Create Custom Dimensions” button.
    5. Select “Event” for scope and type “GCLID” for Event parameter.
    6. Name your dimension as “Google Click ID”.
    7. Click the “Save” button to create your new custom dimension.

    Create new variable on Google Tag Manager (GTM) to capture GCLID from URL

    When a user clicks on your ad, Google adds a GCLID to the end of the URL. Unfortunately, Google Analytics doesn’t collect this information by default. We need to somehow separate the GCLID from the URL and send it to Google Analytics. For this, we need the Google Tag Manager. With a variable that we’ll create in Google Tag Manager, we can easily do this and send the GCLID to Google Analytics for storage.

    1. Go to Google Tag Manager.
    2. Navigate to the “Variables” page by clicking the “Variables” button in the left sidebar.
    3. Click the “New” button on the User-Defined Variables panel.
    4. Click the “Variable Configuration” panel to configure your new variable.
    5. Choose “URL” for variable type.
    6. Choose “Query” for component type.
    7. Type “gclid” for query key.
    8. Name your variable as you wish and click “Save” button in the top right corner.

    After following the steps above, Google Tag Manager will be able to separate GCLID from URL to store it in variable. Now all we have to do is send this variable to Google Analytics on user visits.

    Create new tag on Google Tag Manager to send GCLID to Google Analytics 4

    In the previous steps, we separated the GCLID from the URL and stored it as a variable. However, this variable is still only available in Google Tag Manager, not in Google Analytics. In this step, we add a new tag to Google Tag Manager to send this variable to Google Analytics.

    If you don’t have an Analytics Tag that you use to send your data to Google Analytics 4

    1. Navigate to the “Tags” page by clicking the “Tags” button in the left sidebar.
    2. Click the “New” tab in the Tags panel to create a new tag.
    3. Click the “Tag Configuration” panel to configure your new tag.
    4. Select “Google Analytics: GA4 Configuration” as the tag type.
    5. Type the “Measurement ID” in the Tag Configuration panel. (Don’t know how to get Measurement ID? Visit the support page to learn.)
    6. Click the “Fields to set” and then click “Add Row”.
    7. For “Field Name”, type the “GCLID” which is the user property of the custom definition you created earlier.
    8. For “Value”, click the plus button and choose the GTM variable you created for GCLID in the previous steps.
    9. Click the “Triggering” panel to adjust trigger for this tag.
    10. Select “All Pages
    11. Name the new tag as you wish and click “Save” to save it.

    If you already have an Analytics Tag that you use to send your data to Google Analytics 4

    1. Navigate to the “Tags” page by clicking the “Tags” button in the left sidebar.
    2. Click on your existing “Google Analytics: GA4 Configuration” tag to configure it.
    3. Click the “Tag Configuration” panel to edit your Tag Configuration.
    4. Click the “Fields to set” and then click “Add Row”.
    5. For “Field Name”, type the “GCLID” which is the user property of the custom definition you created earlier.
    6. For “Value”, click the plus button and choose the GTM variable you created for GCLID in the previous steps.
    7. Click the “Save” to save changes on the Tag.

    You’re all set

    After the completing steps above, you’ll be able to see GCLID on Google Analytics reports. If you want to access this data programmatically please also have a look at our post about using the GA4 Reporting API to fetch GCLID data. Using the GCLID for Offline Conversion imports to your Google Ads Account might be an interesting next action for you.

    Note that, GCLIDs won’t be retroactively added to your old reports. You can see how the whole process works as presented below.

    Also remember to check GA4 event collection limits for the most up-to-date Google documentation.

    Google Analytics

    More Similar Posts

    Menu