Today I set up a custom shortlink: https://zetamode.com/questionnaire pointing to a Google Form (Click it if you speak french and are interested in online fashiown game, we’re doing a survey !)
The zetamode.com website is hosted with GitHub Pages, so I cannot go with an HTTP redirect. And I want to track the origin of the shortlink users through my Piwik instance.
You can have a look at the actual file here, but below is a more generic version you are welcome to edit to fit your needs:
And to use it:
Note: The SO answer I based my code on states that
you should not use
page.redirect_to as the parameter name, as it will conflict with the
which I believe is enabled on GitHub Pages (didn’t test myself).
So far it seems this method works !