Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Best Method for Link Tracking

Avatar

Avatar
Level 1
courtneya707225
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
courtneya707225
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
courtneya707225
Level 1

16-04-2020

I am currently rebuilding a site's analytics code from scratch and for link tracking, the current implementation relies on CSS selectors with data- attributes. I've used this method in the past, but this makes me reliant on front-end changes, and could be liable to break during any new release. In the past, I've also used custom events passed to me through the front-end, but then that also makes the Launch implementation even more reliant on front-end releases (but less likely to break), thereby circumventing the whole notion of a tag manager.

 

Thoughts?

 

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Andrey_Osadchuk
MVP

Likes

509 likes

Total Posts

917 posts

Correct Reply

243 solutions
Top badges earned
Coach
Contributor
Seeker
Bedrock
Boost 500
View profile

Avatar
Coach
MVP
Andrey_Osadchuk
MVP

Likes

509 likes

Total Posts

917 posts

Correct Reply

243 solutions
Top badges earned
Coach
Contributor
Seeker
Bedrock
Boost 500
View profile
Andrey_Osadchuk
MVP

16-04-2020

From my point of view, your current approach is the best practice. The only addition I would advise to consider is when the link tracking is associated with single page applications (SPA). For SPA custom events or event based data layer may work better, primarily for the links that are triggering app state changes.

Answers (0)