You are currently viewing How to track any types of link clicks in GA4 with Google Tag Manager

How to track any types of link clicks in GA4 with Google Tag Manager

In this article we will understand how you can track the link clicks data of your website through google tag manager in 2024 and pass the data in google analytics 4.

How to track link clicks

At first you set to set up a trigger to check whether your gtm can track the lick click data of your website.

Step 1: Set up Trigger

Click on triggers go to configure and click just links

Select the trigger type all links as we want to track all links of the website. You can also select some link clicks if you want to track a specific link type.

So now you have set up link click triggers it’s time to preview if its working properly or not, go to the preview mood and select your website and click on any anchor link

 and you can see a link click options in the left side.

On the right side in the variable sections we can see all the variables here like page name, page hostname, click class etc. In the page url we can see that te link click has been a made from the specific page.

Turn on the build in variables

If you want to see more data you need to configure the variables sections and click configure 

Then you need to make sure make sure all the variables are turn on

Now if you check preview mood you can see a lot more variables there

Step 2: Set up the Tag

Set up the the tag and we need to pass the data to google analytics as an event

Select your ga4 measurement id and set the evet parameters as click url and select the link clicks trigger to complete the set up

Now check with preview mood to see whether the data is showing or not in ga4

If you set up it properly you will see the data in ga4

So this is how you can track the link clicks of your website in ga4 with Google tag manager.