I’ve seen the odd tutorial doing this in GA but I want to use piwik as I’ve had it installed on my website for ages? I’ve looked up info on Goals & campaigns but can’t work out how to use it as a redirect.
Many thanks and I look forward to any advice offered.
using tracking API, similarly to what is explaiend in this post: 301 Moved Permanently
load an empty HTML page with the Piwik code in it, and do a HTML meta refresh redirection after 1 or 2 seconds (to leave time for Piwik beacon to load)
Great, if you manage to make it work, it’s appreciated if you can post a simple “How to track newspaper/TV ad with Piwik” in the forum: 301 Moved Permanently
Damn, I’m not as clever as I thought I was. How is that possible
I’ve created the new folder titled 2012 on the root directory and inside the folder have a single file titled index.html with the following code in it.
(apologies but I had to rename the site to ‘mywebsite’ as it’s currently quite a private one until up and running correctly)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="robots" content="noindex", "nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="5;url=http://www.mywebsite.com">
<title>Demonstration</title>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.mywebsite.com/piwik/" : "http://www.mywebsite.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.setDocumentTitle(document.title);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://www.mywebsite.com/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
</head>
<body>
<p> </p>
You should be automatically redirected to the <a href="http://www.mywebsite.com">mywebsite</a> homepage within 5 seconds.
</body>
</html>
Silly me… I missed the obvious. It works now and I also have a goal set up to check for the title of the redirecting index page
Full working code is: (the winking smiley seems to be replacing the ; and )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="robots" content="noindex", "nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="3;url=http://www.mywebsite.com">
<title>mydemo</title>
</head>
<body>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.mywebsite.com/piwik/" : "http://www.mywebsite.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.setDocumentTitle(document.title);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://www.mywebsite.com/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
<p> </p>
You should be automatically redirected to the <a href="http://www.mywebsite.com">mywebsite.com</a> homepage within 3 seconds.
</body>
</html>
Note that the part where it says you can change the number ‘3’ to however many seconds you want. You could also add a small logo/image to the page just for people to look at.
Then you can very easy also make different tracking IDs to track different ads, and also set up goals - and see how much value each ad/ visitor brings you…
POS, such URL is not good to put in an ad/newspaper for people to type in their browser.
andrew222, please create a simple post with your final working prototype in this forum: 301 Moved Permanently
I’m sure other users will benefit from this tip!
Well, redirecting a visitor with a meta refresh, while displaying a “please wait…” or an empty site is not a good idea either. Your bounce rate will quickly rise for sure.
Why not sending your visitors to your main domain with a link, containing a parameter? “yourwebsite.com” - this is not worse than sending them to “yourwebsite.com” and redirecting them via a meta-refresh.
Should do the trick. (UNTESTET!!). This is the best solution but could produce “dupe content”. So you would have to exclude “/2012” via your robots.txt.
The client doesn’t want to print anything complicated in the brochure for the url (no question marks, numbers etc) and just wants something that’s easy to remember and the 2012 is just something to separate it from the main url and to track it as a goal. Future print advertising campaigns can use this same method by simply changing the name.
It’s bad enough that the website is actually built using the ‘nasty’ ModX cms which I soon hope to convert to Joomla.
I don’t believe that waiting 3 seconds would cause any raise in bounce rates due to the nature of the site (it’s a state park) although thinking about it perhaps I should add some sort of image on there for them to look at during their brief stay on the page. I may try it at 2 seconds to see if that works ok with Piwik.
Right, but nobody likes to enter a client side redirect URL. Also, if somebody shares the link online, someone will rather share a link to content, not a redirection link. So you could further track campaign success cross media.
but nobody likes to enter a client side redirect URL.
That wasn’t my idea neither. I don’t like meta-refresh or javascript redirect myself I suggested using htaccess as first mentioned by you. OR domain redirect (that is basically the same thing, but just another technique) to the Piwik campaign URL.
BUT if the main purpose is to get the email adress of the newspaper reader, I would suggest to go another route that has in many experiments worked much better:
Give something away for free.
Example:
Let’s say you are a local house painter. In your ad you could have written something like this: “Get the guide for better house oainting for free”. or “5 things you MUST know about when hiring a painter for your house” - then write: “Send a (blank) email to paintguide@mydomain.com - and you’ll receive it in you inbox immediately”
This has been tested in newspapers before, and done great.
The reason is that the conversion rate is 100% when using this method. (!00% of the ones that first respond to your ad signs up…)
The opposite is doing what it seams to me you are planning to do: Thinking of having an “offline” ad, that should get people to visit an online page. Then the visitors must add their email adress (and name?) to get acces to what you offer… Usually appr 10% of people coming to an online “opt in” page signs up. But in my example above ALL that sends you an email signs up…
Another case is that it is easier for me (using a smart phone) to send you an email, than opening a web page, read it - and then add my email adress etc in a “email box”.
And therefore, the .htaccess / campaign solution is best. No matter where your visitors come from (opt in eMail, offline, online, cross media, etc.). This has IMO nothing to do with marketing strategy but with performance analytics of whatever your marketing efforts may be.
Hi Peter.
I am POS, and I have not written that text you quote. That is written by the thread starter, and that is andrew222
[quote=Peter]
And therefore, the .htaccess / campaign solution is best.
[/quote] Yes, I agree. That is why I wrote : “I would definetly use htaccess as mentioned above, in combination with the URL I posted.” (that is the Piwik campaign URL)
Yes, it has. BUT you do performace analytics to get better at choosing the best strategy. And the solution with sending emails has shown before to be better all in all when using newsletter ads (offline) to collect email adresses. (As Andrew222 are going to.) It also is a great way to measure the performance, as you get complete stats (just not in Piwik ) - So my writing was just an advice to him.
The .htaccess/ campaign URL solution is the best “redirect solution” I know, together with the (sub-)domain forwarding to the same campaign URL. Meaning you can either use htaccess or the domain manager to set it up.: