zgall1
zgall1

Reputation: 3025

Why is the outbound link equal to "(not set)" in Google Analytics when I try to track it using Google Tag Manager?

Using Google Tag Manager, I have set up a trigger/tag configuration to track the originating page URL and referring page URL on an outbound link click.

Trigger Configuration

Tag Configuration

When I view the Events data in Google Analytics, all of the originating page URLs are tracked but half of the Event Labels (which should contain the referring page URL or Click URL in the terminology of GA) are equal to (not set).

I thought that this might be happening because the GTM code did not always have a sufficient amount of time to load so I checked "Wait for Tags" but this did not seem to have any effect (note that when I checked "Wait for Tags", I had to enable a trigger condition so I set it such that the Click URL does not equal the gibberish string that you see in the screenshot).

Does anyone have any idea what might be happening here?

Upvotes: 0

Views: 1593

Answers (1)

CVM
CVM

Reputation: 800

"Wait for Tags" is unlikely to come into play here. Were there a delay in the tag firing, you'd see no data in Google Analytics for that event at all.

It sounds like you might have some links in your pages that don't have the href attribute set on them. In this situation, the {{Click URL}} would be an empty string, leading to the label getting the "(not set)" value in the Google Analytics reporting.

Consider adding a condition on your trigger to assert that the {{Click URL}} must be a valid URL (for example, starts with "http").

Upvotes: 1

Related Questions