ad goal tracking

This commit is contained in:
2020-02-23 12:27:35 +01:00
parent 1107ecbdad
commit b64777b94a
2 changed files with 17 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package webcontroller
import (
"net/http"
"time"
"fornaxian.com/pixeldrain-api/util"
@@ -26,3 +27,15 @@ func (wc *WebController) serveAdClick(w http.ResponseWriter, r *http.Request, p
log.Warn("Failed to log view")
}
}
func (wc *WebController) serveCampaignPartner(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
http.SetCookie(w, &http.Cookie{
Name: "pd_campaign",
Value: p.ByName("id"),
Path: "/",
Expires: time.Now().Add(time.Hour * 24),
})
// Redirect the user to the home page
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}