简体   繁体   中英

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.

触发配置

标签配置

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?

"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").

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM