Append a function to outbound links

I’m trying to set up my webflow-based site to pass affiliate link information over to a wordpress-based site that has AffiliateWP installed on it. This way, an affiliate could send someone to one of our resources, but still get credit for a purchase if the referred visitor leaves the webflow site and purchases on our wordpress site with AffiliateWP installed.

Apparently, this is how I’m supposed to do it. But I really don’t know what this means. Can anyone tell me how (/if it’s possible) to “append this function to my purchase links”, as described below?

Here’s my read-only link:

     * Non WordPress version of
     * Useful for when your landing page is on a separate domain where AffiliateWP is not installed.
     * Retrieves the referral variable and value from the landing page's URL and passes it to the purchase button/s on the same page.
     * When a customer clicks the purchase button/s, they will be taken to your e-commerce site where the proper affiliate will be tracked/awarded commission.
     * Append the function to your purchase links like so:
     * <a href="<?php if ( function_exists('affwp_custom_append_affiliate_id') ) { echo affwp_custom_append_affiliate_id(); } ?>">Buy now</a>
     * Example:
     * Customer is sent to your landing page with a URL of
     * This will result in the outbound link having a URL of:
    function affwp_custom_append_affiliate_id() {
    	// Set the referral variable. It should match the same one you are using in AffiliateWP
    	$referral_var = 'ref';
    	// get the value of the referral variable from the URL
    	$affiliate_id = isset( $_GET[$referral_var] ) ? $_GET[$referral_var] : '';
    	// if the referral variable exists, return a formatted query string for use in our links Eg. /?ref=123
    	if ( $affiliate_id ) {
    		return '/?' . $referral_var . '=' . $affiliate_id;

You cannot run PHP code in Webflow sites. Is there a JavaScript version of this?

Doesn’t appear to be. I’ll reach back out to AffiliateWP to find out. Thanks for chiming in, samliew!