DNNCommunity / DNN.Vendors

The Vendors module project allows admins to manage Vendor relationships and add Advertising banners to their site.
MIT License
7 stars 10 forks source link

Affiliate Links Don't Work #11

Open benjironelson opened 7 years ago

benjironelson commented 7 years ago

Installed the module in Evoq Content 8.5.0. Added a new Vendor Created an affiliate link Added "affiliateId" to the "KeepInQueryStringRegex" in AUM Copied the link from the notification Accessed the link with affiliateId in private browser session

No clicks are being logged by the module for that vendor.

benjironelson commented 7 years ago

I have found a relevant detail. In older versions of DNN, this code block was in default.aspx.vb:

        ' affiliate processing
        Dim AffiliateId As Integer = -1
        If Not Request.QueryString("AffiliateId") Is Nothing Then
            If IsNumeric(Request.QueryString("AffiliateId")) Then
                AffiliateId = Int32.Parse(Request.QueryString("AffiliateId"))
                Dim objAffiliates As New Services.Vendors.AffiliateController
                objAffiliates.UpdateAffiliateStats(AffiliateId, 1, 0)

                ' save the affiliateid for acquisitions
                If Request.Cookies("AffiliateId") Is Nothing Then       ' do not overwrite
                    Dim objCookie As HttpCookie = New HttpCookie("AffiliateId")
                    objCookie.Value = AffiliateId.ToString
                    objCookie.Expires = Now.AddYears(1)       ' persist cookie for one year
                    Response.Cookies.Add(objCookie)
                End If
            End If
        End If

Perhaps this should be put into a Vendors module specific HTTPModule to resolve this issue.