Expand my Community achievements bar.

SOLVED

Track all links on page regardless of being internal or external

Avatar

Level 3

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!

1 Accepted Solution

Avatar

Correct answer by
Level 4

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>

View solution in original post

5 Replies

Avatar

Administrator

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.h...

// 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

Avatar

Level 3

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

Avatar

Correct answer by
Level 4

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>

Avatar

Level 3

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?

Avatar

Level 4

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