Analytics
1.8K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Labels for links

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We check if one watched a video on our website and analytics is tracking this URL e.g.:

 

/videos/4f2e877e-2666-11e6-80f9-1fb6d282c277 the full URL is then https://alugha.com/videos/4f2e877e-2666-11e6-80f9-1fb6d282c277

 

The specific video page for a language has a label which in this case is "Final Four Mannheim 2016".

 

My question is: Is it possible to use this label instead of the /videos/4f2.... on Google Analytics? Is there a way I can replace that?

 

Thx!

Bernd

1 Expert replyverified_user

Re: Labels for links

Top Contributor
# 2
Top Contributor
Hi,

sure it is. It requires some coding, but definitely doable.

First however I would recommend that you move your GA code to head section. Also it seems that you are firing the tracking code twice. I did not debug your code so I cannot give you specifics, sorry.
Also it seems that the event was fired even if I did not start the video...

But the main issue:
Use this Javascript to print H1 (your page heading) to the GA event tracking code:
document.getElementsByTagName("h1")[0].innerHTML

Let me know if you need more assistance

--
To make bad day worse, spend it wishing for the impossible

Re: Labels for links

Follower ✭ ✭ ✭
# 3
Follower ✭ ✭ ✭

The easies way to do it is by doing your event tracking via GTM and having a lookup table which replaces specific values with other values.
http://www.simoahava.com/analytics/google-tag-manager-lookup-table-macro/#gref

This would be the correct way of doing it (or the way Antti explained) cuz you fix the issue at collection.

You can also fix it in GA by creating a rewrite filter

Screen Shot 2016-06-01 at 11.05.22 AM.png