[Skip to main content](#vessel-content)

#   Tracking affilliate-based purchases

##

- **[drives](/forum/user/27841-drives "View drives's Profile")**
- [![drives's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27841-drives "View drives's Profile") Topic Author
- [ Offline](/forum/user/27841-drives)

Less More

- Posts: 3
- Thank you received: 0
-
-

13 years 1 month ago [\#122836](#122836) by [drives](/forum/user/27841-drives "View drives's Profile")  *[Tracking affilliate-based purchases](/forum/39-affilation/861870-tracking-affilliate-based-purchases#122836 "-- HikaShop version -- : 2.1.3 -- Joomla version -- : 2.5.11 -- PHP version -- : 5.3.19 -- Browser(s) name and version -- : Chrome  I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:  1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?  2. When I look into the database I see that the user&#95;partner&#95;id is 0 for all the users in the xxx&#95;hikashop&#95;user table. Is there something wrong with my setup?  Thanks")* was created by *[drives](/forum/user/27841-drives "View drives's Profile")*

-- HikaShop version -- : 2.1.3
-- Joomla version -- : 2.5.11
-- PHP version -- : 5.3.19
-- Browser(s) name and version -- : Chrome

I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:

1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?

2. When I look into the database I see that the user_partner_id is 0 for all the users in the xxx_hikashop_user table. Is there something wrong with my setup?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODYxODcwLXRyYWNraW5nLWFmZmlsbGlhdGUtYmFzZWQtcHVyY2hhc2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 1 month ago [\#122929](#122929) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Tracking affilliate-based purchases](/forum/39-affilation/861870-tracking-affilliate-based-purchases#122929 "-- HikaShop version -- : 2.1.3 -- Joomla version -- : 2.5.11 -- PHP version -- : 5.3.19 -- Browser(s) name and version -- : Chrome  I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:  1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?  2. When I look into the database I see that the user&#95;partner&#95;id is 0 for all the users in the xxx&#95;hikashop&#95;user table. Is there something wrong with my setup?  Thanks")*

Hi,

1. Both. Cookie for guest and we store the partner if the guest creates an account.

2. I think that's because you didn't create the account with a partner link.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [drives](/forum/user/27841-drives "View drives's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODYxODcwLXRyYWNraW5nLWFmZmlsbGlhdGUtYmFzZWQtcHVyY2hhc2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[drives](/forum/user/27841-drives "View drives's Profile")**
- [![drives's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27841-drives "View drives's Profile") Topic Author
- [ Offline](/forum/user/27841-drives)

Less More

- Posts: 3
- Thank you received: 0
-
-

13 years 1 month ago [\#122981](#122981) by [drives](/forum/user/27841-drives "View drives's Profile")  Replied by *[drives](/forum/user/27841-drives "View drives's Profile")* on topic *[Tracking affilliate-based purchases](/forum/39-affilation/861870-tracking-affilliate-based-purchases#122981 "-- HikaShop version -- : 2.1.3 -- Joomla version -- : 2.5.11 -- PHP version -- : 5.3.19 -- Browser(s) name and version -- : Chrome  I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:  1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?  2. When I look into the database I see that the user&#95;partner&#95;id is 0 for all the users in the xxx&#95;hikashop&#95;user table. Is there something wrong with my setup?  Thanks")*

Thanks for answering my question Jerome. I have a couple more questions to clarify your answer.

1. Is there any way to make this process automated on the website. So that when a user "registers" through the checkout process that the partner_id is automatically put in to that user's record?

2. Is there a way to get the partner_id from a user's cookie for other actions - such as when they fill out an RSForms form?

3. How long does the cookie last?

Thanks,
Matt

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODYxODcwLXRyYWNraW5nLWFmZmlsbGlhdGUtYmFzZWQtcHVyY2hhc2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 1 month ago -  13 years 1 month ago [\#123122](#123122) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Tracking affilliate-based purchases](/forum/39-affilation/861870-tracking-affilliate-based-purchases#123122 "-- HikaShop version -- : 2.1.3 -- Joomla version -- : 2.5.11 -- PHP version -- : 5.3.19 -- Browser(s) name and version -- : Chrome  I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:  1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?  2. When I look into the database I see that the user&#95;partner&#95;id is 0 for all the users in the xxx&#95;hikashop&#95;user table. Is there something wrong with my setup?  Thanks")*

Hi,

1. It is already the case.

> we store the partner if the guest creates an account.

2. You can retreive the partner id using this code: Code:

$partner_id = hikashop_decode(JRequest::getCmd('hikashop_affiliate',0,'cookie'),'partner');

3. You can configure this value with the option "Validity period of a click for leads and sales"; by default it's 30 days.
[ www.hikashop.com/support/documentation/5...l#features\_affiliate](http://www.hikashop.com/support/documentation/54-hikashop-config.html#features_affiliate)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 13 years 1 month ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

The following user(s) said Thank You: [drives](/forum/user/27841-drives "View drives's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODYxODcwLXRyYWNraW5nLWFmZmlsbGlhdGUtYmFzZWQtcHVyY2hhc2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[drives](/forum/user/27841-drives "View drives's Profile")**
- [![drives's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27841-drives "View drives's Profile") Topic Author
- [ Offline](/forum/user/27841-drives)

Less More

- Posts: 3
- Thank you received: 0
-
-

13 years 1 month ago [\#123157](#123157) by [drives](/forum/user/27841-drives "View drives's Profile")  Replied by *[drives](/forum/user/27841-drives "View drives's Profile")* on topic *[Tracking affilliate-based purchases](/forum/39-affilation/861870-tracking-affilliate-based-purchases#123157 "-- HikaShop version -- : 2.1.3 -- Joomla version -- : 2.5.11 -- PHP version -- : 5.3.19 -- Browser(s) name and version -- : Chrome  I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:  1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?  2. When I look into the database I see that the user&#95;partner&#95;id is 0 for all the users in the xxx&#95;hikashop&#95;user table. Is there something wrong with my setup?  Thanks")*

Thanks for that Jerome, this solves my problem. Although it still doesn't explain why the partner_id is 0 for all our customers who went on to purchase after clicking on an affiliate link? But I should be able to solve this with the code you gave me.

Thanks, ![:)](/media/kunena/emoticons/8.png ":)")
Matt

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODYxODcwLXRyYWNraW5nLWFmZmlsbGlhdGUtYmFzZWQtcHVyY2hhc2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 1 month ago [\#123162](#123162) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Tracking affilliate-based purchases](/forum/39-affilation/861870-tracking-affilliate-based-purchases#123162 "-- HikaShop version -- : 2.1.3 -- Joomla version -- : 2.5.11 -- PHP version -- : 5.3.19 -- Browser(s) name and version -- : Chrome  I am looking to check purchases associated with an Affiliate using the hikashop database and I have found that even though I have many affiliates (partners) setup in Hikashop and the Affiliate program is capturing click counts it is not doing a good job of capturing sales by affiliates. My questions with this are:  1. Does the affiliate program use cookies or just a session in the database to track sales? My main question here is if a person doesn't buy when they use the affiliate link but then returns later to my site and buys - does this purchase get attributed to the affiliate?  2. When I look into the database I see that the user&#95;partner&#95;id is 0 for all the users in the xxx&#95;hikashop&#95;user table. Is there something wrong with my setup?  Thanks")*

Hi,

You can take a look at the system plugin "hikashopaffiliate".
You will see that the there is a trigger for "onAfterStoreUser" which set the partner id.
There are some conditions to validate the affiliation during the registration.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [drives](/forum/user/27841-drives "View drives's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODYxODcwLXRyYWNraW5nLWFmZmlsbGlhdGUtYmFzZWQtcHVyY2hhc2VzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.112 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
