Track all links on page regardless of being internal or external | Community
Skip to main content
OwlyChick
Level 3
March 14, 2016
Solved

Track all links on page regardless of being internal or external

  • March 14, 2016
  • 5 replies
  • 3641 views

I need to be able to track clicks on different links within an infographic on a page. I've been told ClickMap does not track links to external sites. What is the easiest way to accomplish this? I do all my edits to code within DTM. Thank you!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JillsMatthew

OwlyChick wrote...

Thank you! Unfortunately I don't configure SiteCatalyst via CQ. I do it via DTM and a header and footer :(

 

Hope this helps! You can configure DTM to use the same method

<script>   $('a').on("click",function() {     s=s_gi(s_account);     s.linkTrackVars = 'prop10';     destURL = $(this).attr("href");     s.prop10 = destURL;     s.tl(this,'o','Link Clicked');     console.log("Clicked link is: ", destURL);   }); </script>

5 replies

kautuk_sahni
Community Manager
Community Manager
March 15, 2016

Hi

Please have at this documentation, i hope this will help you:

Link:- https://docs.adobe.com/docs/en/aem/6-1/administer/integration/marketing-cloud/sitecatalyst/sc-link.html

// Tracking External Links

Configure external link tracking

 

  1. In your framework, expand the Link tracking Configuration area.
  2. Deselect Track Downloads.
  3. Select Track External.
  4. Deselect Leave Query String.
  5. Use the following value for the External Filters list to identify it as an external URL:

    yahoo.com
     
  6. Add the following value to the Link Track Events field:

    event1,event2
     
  7. Add the following value to the Link track vars field:

    eVar1,eVar2
     
  8. On the page that is associated with the framework, add a Text component. Inside the Text component, add a hyperlink pointing to the following address:

    http://search.yahoo.com/?p=this
     
  9. Switch to Preview mode and click the link. 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
OwlyChick
OwlyChickAuthor
Level 3
March 15, 2016

Thank you! Unfortunately I don't configure SiteCatalyst via CQ. I do it via DTM and a header and footer :(

JillsMatthewAccepted solution
Level 4
March 16, 2016

OwlyChick wrote...

Thank you! Unfortunately I don't configure SiteCatalyst via CQ. I do it via DTM and a header and footer :(

 

Hope this helps! You can configure DTM to use the same method

<script>   $('a').on("click",function() {     s=s_gi(s_account);     s.linkTrackVars = 'prop10';     destURL = $(this).attr("href");     s.prop10 = destURL;     s.tl(this,'o','Link Clicked');     console.log("Clicked link is: ", destURL);   }); </script>
OwlyChick
OwlyChickAuthor
Level 3
March 16, 2016

Thank you! So I need to put in the domains for the external URLs, correct? We will be creating these infographics on a weekly basis and they will all have different links to different domains. Is there any way to tell SiteCatalyst to just track clicks regardless of domain without disrupting my analytics on the remainder of the site?

Level 4
March 16, 2016

OwlyChick wrote...

Thank you! So I need to put in the domains for the external URLs, correct? We will be creating these infographics on a weekly basis and they will all have different links to different domains. Is there any way to tell SiteCatalyst to just track clicks regardless of domain without disrupting my analytics on the remainder of the site?

 

 

 

Instead of 'attr' try using prop, it should give you the full URL including domain

destURL = $(this).prop("href");