Sales Tracking Code To Be Fired Only When User Visits Through Affiliate Link

Urgent Help Required. Thanks in Advance

I need the below mentioned pixel to be fired only when someone comes from this link to my website and purchases the product. Please tell me how can I do it. Currently it gets fired on every purchase that is made on the website. So my all sale data is going to the affiliate marketing company -

Link - www.name.com?utm_source=Optimise&utm_medium=affilate-%7Baid%7D&utm_campaign=CPS

Tracking Pixel -

{assign var="remote_sites_of_interest" value=["example.com","example2.com"]}
{if $smarty.server.REFERER|strpos:$remote_sites_of_interest !== false}

{/if}

{assign var="remote_sites_of_interest" value=["example.com","example2.com"]}
{if $smarty.server.REFERER|strpos:$remote_sites_of_interest !== false}

{/if}
 

But what if the utm source link is of my own website only.

and the sales should be tracked for 30 days from the date someone comes to my website from the affiliate

and the sales should be tracked for 30 days from the date someone comes to my website from the affiliate

Hello!

Try to save the affiliate ID in session and check it on the checkout complete page.

Hello!

Try to save the affiliate ID in session and check it on the checkout complete page.

How can I do that, I am new to this.

How can I do that, I am new to this.

Are you familiar with the add-on creation? You can create init.post.php file and process incoming parameters there. You can read more about pre/post controllers here: http://docs.cs-cart.com/4.5.x/developer_guide/core/controllers/pre_postcontrollers.html

Are you familiar with the add-on creation? You can create init.post.php file and process incoming parameters there. You can read more about pre/post controllers here: http://docs.cs-cart.com/4.5.x/developer_guide/core/controllers/pre_postcontrollers.html

Can you help?

But what if the utm source link is of my own website only.

You can add any URL/URI references to the "value" array where example.com and example2.com are used. It shows you how to have it work for more than one URL/URI.

Can you help?

You can try the solution suggested in this ticket first. If it does not work we will try to find other solution.

You can try the solution suggested in this ticket first. If it does not work we will try to find other solution.

I am no programmer. Unable to do it. Can pay 25$ for this work.

Anyone Can do it for me?