We have a marketing campaign that sends out a mailer to potential customers, that mailer has a QR code that has specific parameters on it.
The gist of the flow is “If param X is present, assign cookie. If Cookie is present, change phone number from xxx-xxx-xxxx to yyy-yyy-yyyy” and some other stuff.
Is there a plugin event for this? I’d prefer to do it without messing with more clientside javascript than I have too.
So the qr code would have a link like site.com?utm_code=soemthing and i’d like to use that utm_code param to determine if the changes should happen. I don’t know if $_SESSION would work because I need the value to be present for 30 days.
An event for what exactly?
I was thinking something between receiving the request with the ?utm_id in the url and showing the page to the browser. Then I could change the phone number before the browser receives the file.
As you will access $_GET or $_COOKIE to determine if someone used the QR-Code, you could theoretically use any event (that is invoked on a normal MODX page request).
The event OnWebPagePrerender would give you access to the whole parsed output, so you could use string replacement to change the number.
It might be easier though to just use a snippet call in the place where the phone number is output.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.