La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
The CTA links appear to be a long text with tracking parameters and I don't want it. Is there a way to track not through CTA buttons - but through the JS code?
The first question is, why don't you want to have long urls inside your CTA?
The CTA from HubSpot needs to have these parameters to track events.
I don't think you can disable it, since it won't have the effect of tracking.
If you don't want the long url, you can make your custom CTA's within by building a custom module.
For tracking you can use multiple ways to track this like:
- Adding UTM tags to every link
- Setup GTM and specify the CTA's
In my opinion, you sould build custom CTA's witin your modules. You don't need to track every CTA on every section that will link to internal pages unless it's a landingpage. HubSpot CTA's will add javascript that will slow down your page that can effect website performance.
Hi Jack , Apply this in main JS file. via using this JS you can shorten the url (Replace the CTA class if different i belive you don't need to change anything) // Get all links with class 'cta_button' var linkscta = document.querySelectorAll('a.cta_button'); // Loop through all links and add a click event listener for (var i = 0; i < linkscta.length; i++) { linkscta[i].addEventListener('click', function(event) { // Prevent the default link behavior event.preventDefault(); // Get the link's href var href = this.getAttribute('href'); // Remove any HubSpot tracking parameters from the href href = href.replace(/\?__hstc=.+&?/, '?'); href = href.replace(/&__hssc=.+&?/, '&'); href = href.replace(/&__hstc=.+$/, ''); href = href.replace(/([&?])hsCtaTracking=([^&%]*(%7C[^&]*)?)/, '$1'); // href = href.replace(/[?&]utm_(source|medium|campaign|term|content)=[^&#]+/gi, ''); // href = href.replace(/[?&]fbclid=[^&#]+/gi, ''); // href = href.replace(/[?&]utm_(source|medium|campaign|term|content)=twitter[^&#]+/gi, ''); // href = href.replace(/[?&]utm_(source|medium|campaign|content)=linkedin[^&#]+/gi, ''); // Navigate to the new URL window.location.href = href; }); }
The first question is, why don't you want to have long urls inside your CTA?
The CTA from HubSpot needs to have these parameters to track events.
I don't think you can disable it, since it won't have the effect of tracking.
If you don't want the long url, you can make your custom CTA's within by building a custom module.
For tracking you can use multiple ways to track this like:
- Adding UTM tags to every link
- Setup GTM and specify the CTA's
In my opinion, you sould build custom CTA's witin your modules. You don't need to track every CTA on every section that will link to internal pages unless it's a landingpage. HubSpot CTA's will add javascript that will slow down your page that can effect website performance.