Disable clkn Wrapper


#22

@Raphael_Walker, This script worked excellently. The other script gave me quite a few issues, like you said. Thanks again.


#23

Thanks for this updated one! Extremely useful for a website caching issue we were having forwarding to /wp-content/ PDFs with /clkn/ parameters :slight_smile:


#24

this works thanks! I just realized unbounce was doing this, I dont understand why you want to sacrifice seo for usability (tracking stuff) in all honesty… If at all you were going to do that than at least mention it somewhere hehe.

Anyway thanks for this


#25

If you don’t want to remove Unbounce’s conversion tracking, there is a solution if you use Google Tag Manager. See this article https://www.simoahava.com/analytics/decorate-links-decorate-forms-tags/. Apply the GA tag with the Decorate Link track type, then use a trigger that only applies to clicks on an unbounce page. You could use a trigger type of Link Clicks, then apply only to some links when the gtm.elementUrl matches regex ((.*)\/clkn\/http\/(.*))|((.*)\/clkn\/https\/(.*))|((.*)\/clkg\/https\/(.*))|((.*)\/clkg\/http\/(.*)). This will decorate all outbound links on Unbounce pages.


#26

Hi,

Does this work for a button with a phone number wrapped in clkn? I added this script and it doesn’t seem to do it. Do I need to manipulate the script anyway or simply add it to the page?

Thanks


#27

If the button has a tel instead of https you would need to update the script to search for that string instead.

Try this if you are using a tel link. You may need to make some changes to the replace function below, but this should get you started.

<script>
lp.jQuery(function() { $('a[href]').each(function() {
	$(this).attr('href', $(this).attr('href')
	.replace(/^\S*clk(n|g)\/https\//gi, 'https://')
	.replace(/^\S*clk(n|g)\/tel\//gi, 'tel:')
	.replace(/^\S*clk(n|g)\/http\//gi, 'http://'));
	});
});
</script>

#28

Thanks! I got it working.


#29

I’m glad to hear that! Happy to help anytime