Affiliate attribution via the email hash

Affiliate attribution via user ID

With affiliate attribution via the email hash, the affiliate is securely assigned to a buyer.

We use the user’s email as the user ID i.e. the hash value of the email address.

If a buyer then enters an email address when making a purchase, we look to see if an affiliate is assigned for that email address i.e. the hash value of the email address.

If yes, the purchase is then assigned to this affiliate and they will receive their sales commission.

What is a hash value?

The hash value is a number that is calculated from the email address. The email address is thereby disguised and cannot be determined from the hash value. Two different email addresses have two different hash values.


The hash value of the email address is:


This value is unique to If you only have the hash value, but do not know the email address, the email address cannot be determined. This way, data protection is guaranteed.

Technical note: The hash value is calculated as follows: $hash = sha256( $email );


  • The affiliate attribution via the email hash is downstream. If an affiliate can be determined via the cookie, this has priority.
  • Please make sure that you have the user’s consent to transfer their email address to Digistore24. Gain the consent of the buyer using a text like this: “I allow my email address to be transferred to for the purpose of order processing.” Please consult a lawyer to find out whether/how you can use this text for your business.

Storing the user ID and the affiliate

You can assign the affiliate to the hash value of the email address in the following ways:

You append the email address as the GET parameter “email” to the promolink:

Promo tracking code

You use a promo tracking code e.g.

<script src=””></script>
digistorePromoPixel( PRODUCT_ID );</script>


The affiliate, campaign key and email address are then read by the GET parameter (if specified).


  • You have the Digistore product 12345.
  • Your affiliates direct visitors to your landing page (e.g. an opt-in page)
  • During the funnel, the visitors enter their email address. They will be redirected (e.g. after an autoresponder opt-in) to a thank you page where the email address is transferred as a GET parameter.
  • Landing page and thank you page are on the same domain (e.g.

On your landing page and on the thank you page you include this code:

<script src=""></script>
digistorePromoPixel( 12345 );

Your affiliates then promote this URL:

as well as this one:  (with # instead of ?)

Your affiliates will then replace AFFILIATE with their own Digistore affiliate ID.

On the landing page, the user is then assigned to the affiliate (still without the email address). The affiliate is stored in the cookie for this purpose.

After the opt-in, the users are then directed to your thank you page:

Your autoresponder software must append the GET parameter to the thank you page URL.

On the thank you page, the hash value of the email address is then assigned to the affiliate.

This allows the affiliate to be correctly assigned when a purchase is made.

Other GET parameter name

If the GET parameter is NOT email, use this code:

<script src=""></script>
digistoreSetEmailParamName( "someotherparamname" );
digistorePromoPixel( 12345 );

WordPress plugin

The tracking code can also be integrated via our Digistore24 WordPress plugin. It is sufficient to:

  • activate the plugin and
  • enter the Digistore24 product ID in the WordPress admin area under Settings > Digistore24.

Advanced options

The following options require programming knowledge. They will only be of interest to you if you employ software developers and have your own platform.

Via API call

Use the Digistore24 API function setAffiliateForEmail().

You can also transfer the hash value directly instead of the email address i.e. hash256( $email )

Via a tracking code

If the email address or the affiliate is recognized in your application, both can be set using a tracking code:

Email address of the affiliate:

<script src=""></script>
digistoreSetEmail( "" );
digistoreSetAffiliate( "someaffiliate" );
digistorePromoPixel( 12345);

You can choose to set only the email address or only the affiliate via the JavaScript function. Missing values are then taken from the GET parameters of the URL.


Updated on 23. February 2021

Was this article helpful?

Related Articles