plainblack.com
Username Password
search
Bookmark and Share

MLredirect Operation

=head1 NAME

Package WebGUI::Operation::MLredirect

=head1 DESCRIPTION

Provides a mechanism to redirect pages from the WebGUI site to external sites.
The redirect will be logged in the server-logs

=head1 SYNOPSIS

<a href="#a=1&b=2&c=3&op=redirectUrl&redirectUrl=http://example.com?mySeo=12345" >Log this redirect</a>

=head1 INSTALL

- Put the script in your custom directory like /data/Custom/lib/WebGUI/Operation
- Copy Operation.pm to your custom directory like /data/Custom/lib/WebGUI/
- Add "redirectUrl" => "MLredirect" to "getOperations" in /data/Custom/lib/WebGUI/Operation.pm
(and integrate new versions to it)

=cut



#-------------------------------------------------------------------

=head2 www_redirectUrl

redirects the user to the specified page.
specified page has to be defined by "redirectUrl=http..."

=cut

Comments
4knowmad: "Hi Martien,

Thanks for sharing this code. I'm not sure I understand how this module differs from the built-in Redirect asset. Can you clarify?

FWIW, I came across your module while looking for a solution that can track redirects in Google analytics. For example, I'd like to know when a visitor goes to a redirect url. Currently the Redirect asset will log the entry in my visitor logs but is not updating Analytics since the GA code is not being sent to the browser as the server (WebGUI) is sending redirect headers. I can add tags to all my links on the site but that's onerous. Any ideas would be appreciated.


Regards,
William"
0martien: "Hi William,

I made the op, because I wanted redirects to show up in my logfiles.
There I find now things like:
85.xxx.xxx.xxx - - [10/Aug/2011:16:18:28 +0200] "GET /websuche?op=redirectUrl;redirectUrl=http://www.xxxx
From my opinion, I can use it also to track actions by adding some other info like actionID=today (before 'redirectUrl=')
and it only would need a small macro to get an overview.

Unfortunately I'm not using Google analytics (but awstats) and there I find the wanted info back.

I think however, this op exactly offers the thing you want.


Regeards,
Martien"
0martien: "Hi William again.

sorry, I missed your crucial point.

It's only meant for links pointing to another site.
The build-in Redirect asset doesn't provide a link to, but the content of another site.

Perhaps putting the link as described in the redirectUrl of the redirect Asset would work.

Martien"
0knowmad: "OK, I think that I understand now. To be sure, the built-in asset does allow me to redirect an url to another site and record the request in the logs. However, it does not include the site url in the logs. So, your custom Operation is helpful when that's desired. Again, thanks for sharing."
DownloadMLredirect_pm.txt MLredirect_pm.txt
LinksMartien Lammers
No Support Offered
Statistics Downloads: 426
Views: 2611
Rating: 4
Updated: 5/19/2011
Keywords Operation Tracking
NavigationMore from Martien Lammers
Back to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved