Add a extra tag to client when buy, manually by jquery from cookie

I need to add an extra tag to my client when he buys a product in Woocommerce. Now a tag is added, but if that customer comes through an affiliate link to my program (use AffilateWP) how do I add the label to the client?

I have an example for Mailchimp, can it be reconverted for INfusionsoft?


This is the example to get the reference of the cookie.
It would be adding a hidden field manually when they come by reference, but I do not know how.

Hi Jesus,

Assuming it’s a first party cookie, something like this could work:

  • create hidden field in wooCommerce called ‘AffTracking’

  • on page load, read the affiliate cookie from AffiliateWP and fill out the hidden field within wooCommerce with that value

  • Inside Infusionsoft you can make a legacy action set that adds a tag- but uses a rule to check AffTracking to see if it has a value

Disclaimer: I’m more of a Shopify person than wooCommerce but hopefully the above helps some.