IF Statement to Display Number of Times Purchased

I am trying to figure out the best way to Display how many times a Specific Product (ideally even the specific variant, but not totally necessary if it makes it way more complicated) has been “purchased.”

I say “purchased” because I am actually using the Checkout to “Sell” Free Deals which are going to be Affiliate Links that I then have emailed to them after “purchasing” a specific product. Reason being, is that I want to have them use my Affiliate Link, but I also want to gather their information so that I can retarget them with other similar deals later as well.

I read that there was no real way to display Number of Times Purchased, but in my searches I found that you could use how many times an item has been Fulfilled. So I went with that assuming the number of times purchased was not actually a thing…

So I basically want it to display a random number between, lets say 10 and 50, but I didn’t know that either, not is that part a big deal at all, so I went with 23, whenever that product has never been purchased. In order to give the illusion that it has been purchased before.

However, when it has been Purchased/Fulfilled, I want to display the real number of times that has happened.

So I tried the code below, and it does not work. As it just always displays 23 no matter what.

But then when I tried taking out the If and Else Statements, and just tried to display the Number of Times Fulfilled, regardless of if that number was 0, it also did not work at all. So I feel like this whole “successfully_fulfilled_quantity” metatag (or whatever they are called) does not actually work?

Can anyone help me accomplish this with whatever code necessary…

Here is an example Product Page that I am trying to display this on…
https://yourbestlifebiz.com/products/bluehost-best-wordpress-website-hosting-domain-registration

<h2>Used <span style="color:red">
{%if successfully_fulfilled_quantity != 0 %} 23
{% else %}
{{ successfully_fulfilled_quantity }}
{%endif%}
</span> Times!
</h2>

Another alternative (which I would also like to know how to do regardless) is…

To just have the button there, and when they click it, it stays on the product page, but then displays a Name, Phone Number, & Email form. OR the form could just be on the page already if need be. But either way, once filled out, it will then display a button with the Affiliate Link assigned to it, using a Product Metafield.

This way, it would not deter people from using it, that are maybe worried that somehow they will be charged something, since they were brought to a Checkout Page. Also this would make it so that I do not have to create a separate customized email to be auto sent to them for every single Product that I do this with. And also so that they do not even have to then go check their email, just to get the Affiliate Link that I send them.

Would be super awesome if someone is able to help me out with both options on this. Thank you VERY much in advance!

1st Part:
That only shows how many products I have in my store. I am trying to display how many purchases of a specific product.

2nd Part:
I think I get what you were trying to say here? And this may work… But how would I display a button, using the Affiliate Link that is specific to that product, if the form is actually on a different page? I don’t think the form even needs to be on a different Page though…

1st Part:
Okay so I found “Sell-through rate by product” in the Reports, but how do I Display that number on the product page?

2nd Part:
I am going to mess around with some forms a bit. But I am trying to do it without having to create a different Form to display every single time. Which I believe I would have to do with the method you are talking about.