Affiliate link tracking through Paypal - cookies

A company I help out have signed up to sell their magazine and newspaper products via an online affiliate.
The affiliate link directs users to a payment page on the client site, but they are using paypal for payments which as you know takes you away from the site.
I'd updated the paypal accounts to redirect back to the client site, where the affiliate tracking code sits, but I believe because we go off to paypal in the middle of the payment, no tracking is sent back.
Essentially, I need Paypal to send a specific code (in this case the merchant ID) and the order value when it redirects.
What would be the best way of doing this?
Thanks
Tom

I would send the affiliate ID in the CUSTOM parameter of your PayPal request and then setup an IPN solution to log the transaction in your database accordingly.
The CUSTOM parameter will come back in IPN so you can easily update your system with the affiliate ID.

Related

How can I tie a stripe webhook to the flask session information of the customer who purchased the product?

I'm creating an online quiz for which the user can pay $5 to get the results. At the end of the assessment, if the user clicks the purchase button, it takes them to a stripe hosted checkout page, and then to a thank you page. The webhook is successfully set up. The problem is that when I try to access information from session (I'm using flask for the backend; session is essentially a cookie) it's a different instance of session than the user's instance. Since the user's answers are stored in the session, I need the webhook to tell the backend to analyze the answers of that specific session. Is that possible?
If anyone has a different solution I'd also love to hear it.
In your Stripe Checkout session you can add a value to client_reference_id. This can be used to identify the customer or their quiz, etc.
See the Stripe documentation here: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-client_reference_id
This value forms part of the Stripe, Create a Session object.
When you get the Webhook payload back it'll tell you what the client_reference_id the webhook relates to so you can query your internal system

How to track client payment information of a visitor redirected from my website

I want to implement a system similar to affilite tracking systems like Skimlinks, Viglink, etc. I searched their customer tracking systems. Found some information about tracking systems. I have also searched Analytics systems like Google Analytics, Piwik, OWA. There is a point I need to be guided.
When a user visits my website, clicks a product link of a shopping website like ebay, amazon, etc. I need to track the payment information of my user at the shopping website.
I achieved tracking user activity, clicks, etc on my web site with using Analytics's tracking methods (JS tracking). But I cannot find a way how Skimlinks or Viglink tracks user activity(succesful payment of users) in the shopping website which user redirected.
(Tracking user activity in the shopping website without using a service from shopping website, without Instant Payment Notification service of PayPay or something else)
I noticed Viglink and Skimlinks redirects user to their server before shopping and adds some additional information (like cookies, URL parameters etc)
Here is an example link to affiliate link of Skimlinks
website : http://www.capoeira-izmir.com/capoeira-kiyafetleri/
link : Street Abada
http://go.redirectingat.com/?id=25227X845172&site=capoeira-izmir.com&xs=1&url=http%3A%2F%2Fwww.ebay.com%2Fitm%2FHELANCA-POLYAMID-CAPOEIRA-PANTS-ABADA-YOGA-FREE-BONFIM-%2F280678232152%3Fpt%3DUS_CSA_MC_Pants%26hash%3Ditem4159b9f058%23ht_2891wt_1163&xguid=94275a6f74c7ce02bf4739e364d8831c&xcreo=0&sref=http%3A%2F%2Fwww.capoeira-izmir.com%2Fcapoeira-kiyafetleri%2F
It redirects user to go.redirectingat.com first, then a redirection is done to ebay.com/...
I also noticed that it adds an attribute to the url of ebay product link : afsrc=1
I guess it is "affiliate source = 1 " or something like that.
Any guidance or documents about this will be great for me.
Thanks in advance!!
I think your question is more about how online advertising works rather than technical.
This is a two parts answer.
1. How a conversion tracking works:
In any advertising platform that tracks conversions (any user action that happens in the advertiser property like, in example, a sale) you need to make a request to the advertising platform to notify this.
This is usually done by placing a "Tracking pixel" in the confirmation page the users see after performing the action, commonly known as the "Thank you page".
So the process goes like:
User goes to a website and sees an ad
User clicks the ad
The user's browser goes to the advertising platform (Adwords, Rightmedia, Appnexus, etc) and a cookie is placed in her browser. In this cookie there's a click ID, containing all the relevant information (website that originated the click, time, IP, campaign, etc) and it is redirected to the advertiser's website
The user lands in the advertiser website and "converts" (buys)
The user is redirected to the Thank you page where a "Tracking pixel" is placed, this makes a request to the advertising platform, which reads the cookies in the user's browser and if there's a match, logs the conversion.
Note: The previous example is a Client Side conversion. The same logic could be done in a Server Side request by the advertiser saving the "click id" in step 4 and sending it to the advertising platform in step 5. This is useful when the conversion occurs offline.
For more information: Adwords Conversion tracking: https://support.google.com/adwords/answer/1722054?hl=en
2. How I assume VigLink works
I noticed that many of the products VigLink tracks are from ClickBank, since this is the one I'm more used to, I will write the answer using this example.
You first need to be aware that VigLink is an "affiliate" of Clickbank. As such, it has a report of every sale made by users they referred. They, as affiliates, also have the chance to pass extra information in each click as a TID parameter. This TID sent as a URL parameter in the click will be shown in the sales report.
When a user clicks on a link to a clickbank product using VigLink. VigLink attaches their affiliate link to this same product and a unique TID. I assume this TID matches an ID in their database containing the information of the VigLink website who referred the click.
If the user buys the product, VigLink will see in their ClickBank report (I assume via the ClickBank API) the product bought and the TID, and so on they will know in which website the sale was originated.
Short answer: VigLink is not tracking user actions in the advertiser's website. They are just matching click IDs between their click tracker and the advertiser's reports.

How can you remove cookies from a specific domain, NOT your own

we have a unique issue.. it seems one of our payment processors offers additional options to users the first time they visit our payment page with the processor - being sent to it from our website. However, the subsequent times our users go to that payment page, those additional options are gone... we believe it has to do with cookie settings from the site.
Is there a way, with the users interaction/approval, to delete cookies from that other domain BEFORE we direct them to that payment page??
So, the process might look something like this:
1) User clicks payment link
2) Confirm box displays notice stating to enable 'these' features, they need to clear their cookies from the site they are being sent to..
3) User clicks yes and all cookies from the other domain are deleted
4) User is then directed to the payment page to complete payment with the additional features.
Thanks!
cookies do not work cross domain, so when your clients go to the payment site, the payment site can not read the cookies that are not set by them
It is a problem of you payment provider and he should solve it! Cookies cannot be read or modified from other domains for security and privacy reasons.

Django, PayPal IPNs & User Names - concept issues

I'm trying to sell virtual goods using PayPal (already implemented Zong+) in Django. I decided to use django-paypal to handle the IPN for me (decided that IPN was the best fully automated option.)
I've currently made a buy-now button using the PayPal button wizard on their website, ie it's secure and saved on paypal to protect against tampering. (I'm very new to PayPal, not living in a fully supported country, so haven't used it myself.)
My questions:
How do I include the username that made the purchase or a similar means of identifying the user that made the purchase with the IPN callback later and retrieve that with django-paypal? Preferably with no means for the user to mess with it.
Should i ditch the auto-generated button and roll my own instead? Will that let me pass extra invisible parameters that PayPal will send in the IPN later?
The Sandbox doesn't let me make User Accounts that I can test on the real site, right? Unless I make a merchant in the Sandbox and make a button for that merchant, I think.
1: If you use the django-paypal PayPalPaymentsForm you can specify a "custom" field containing the username. This will be posted back to you with the IPN. If your buttons are encrypted the user will be unable to tamper with this.
2: Yes, see 1 :-)
3: No, but you can create buyer and seller accounts on the Sandbox.

django-registration with paypal integration

I'm trying to figure out how to integrate django-registration with django-paypal. Being a Django n00b, I'm trying to figure out how to implement a flow like this:
User signs up using django-registation with 'active' flag set to 0
After registering, send user to PayPal for a subscription
When they come back from PayPal successfully, I want to set 'active' to 1
I've been looking at the django-registration documentation and don't quite understand how to use different backends or implement a flow the way I want.
Any tips on how to accomplish this would be greatly appreciated. django-paypal won't be a problem for me as I've done PayPal integration before (in PHP for a self-published book about CakePHP).
To have registration not send an email you pass send_email=False to the RegistrationManager.create_inactive_user call in your view to register a user. After you create the user, you probably want to create a landing page with the paypal buttons for payment. Instruct the user to click a payment button to pay. Generally I send the user.id in the custom field for the payment button.
Then, in django-paypal, use the IPN signal handlers to activate the user based on the user.id in the custom field of the IPN query. You might want to send a modified registration email at this point, welcoming the user to your site and telling them you have received payment and have activated their account, but those are details for you to define.