Adding tags automatically based on a specific part of URL

Hello,

We have a client who has a financial site where in suggestions page they suggest different stock options (for example “AAPL”). Clicking on a stock option, it will take you to a page for that stock (for example client.com is for sale | www.oxley.com).

How can I automatically add a Tag to a user or client based on the stocks they are interested?. Each page use the same type of URL address and the only change on the address is after the “#”, where the stock is added.

Can I add a tag to a contact based on whatever stock appears at the end of the URL?. For example if stock is /#GOOGL the “Stock:GOOGL” is added to the profile.

How can I solve this problem?.

Thanks!,

Max

Hi @activelatam ,

At this time there is no way to automatically tag based on a specific part of the URL. But, this outcome can still be accomplished. The easiest way is to go to “My Settings” and the “Tracking” tab.

  1. Add the domain(s) to the “Domain Whitelist” with and without the “www.”
  2. Copy the Tracking Code (similar to the below) and paste it to the pages you would like to track
        <script type="text/javascript">
            var trackcmp_email = '';
            var trackcmp = document.createElement("script");
            trackcmp.async = true;
            trackcmp.type = 'text/javascript';
            trackcmp.src = '//trackcmp.net/visit?actid=89355064&e='+encodeURIComponent(trackcmp_email)+'&r='+encodeURIComponent(document.referrer)+'&u='+encodeURIComponent(window.location.href);
            var trackcmp_s = document.getElementsByTagName("script");
            if (trackcmp_s.length) {
                trackcmp_s[0].parentNode.appendChild(trackcmp);
            } else {
                var trackcmp_h = document.getElementsByTagName("head");
                trackcmp_h.length && trackcmp_h[0].appendChild(trackcmp);
            }
        </script>

Once the Tracking Code is on the pages you want automatically tagged, you will create an automation, similar to the below image. These automations will need to be created for each page you want automatically tagged.

Hope this helps, Max,

Perry

2 Likes

Thank you Perry, I will try it. Thanks!.

1 Like