0

Is it possible to identify the device which is using each subscriber and store that info as a variable with a value, and after use that value to do something like the example below?

%%[set @myvariable = concat('http://www.example.com/?campaign=', CampaignCode)]%%
    <a href="%%=RedirectTo(@myvariable)=%%">My Link<>
  • Can you elaborate more on the use case? By identifying - do you mean the user-agent string? And is this within an email or on a cloud page? Or do you want to set a cookie on user’s device for later recognition? – Lukas Lunow Feb 21 at 16:27
  • As a note, if it is in an email, you cannot use the user-agent string because that is collected at receipt, not sending - so it is after the server side code has already been compiled and completed. You would only be able to use historic data stored in a DE or CSS to manipulate content based on device for emails. – Gortonington Feb 21 at 17:21
  • @LukasLunow, in our website, when the user wants to make a reservation, a key is granted, depends on the device, (desktop or mobile), this key serves as a filter to send users to the desktop or responsive booking engine. I want to use this feature within the email links, with the data stored in CSS about screen size in order to assign a string value in the button link when is clicked. – Fernando Feb 21 at 19:59
  • This is an example for a booking engine link: reservaciones.granplan.com/Paquetes/… de México (MEX) Aeropuerto Internacional Benito Juárez, México&ni=Riviera Nayarit, México - Aeropuerto Gustavo Díaz Ordaz (PVR)&sd=12/08/2019&ed=14/08/2019&rm=1&ad1=2&ch1=0&ob=mex&ib=PVR&ds=112&hpa=1&ht=4768 . The key value here is "granplanmx0", that would have to be the variable – Fernando Feb 21 at 20:02
0

As it has been pointed out in the comments already, it is not possible to do anything within the email itself, as this has been compiled at send-time - not knowing about the device on which the email will be opened.

I have built similar solutions before, where I have used following approach:

  1. Two versions of the website, e.g.: responsive.example.com and desktop.example.com
  2. A redirect page, built in e.g. PHP, detecting the user-agent, and redirects to either responsive or desktop within milliseconds
  3. A link in your email, pointing to #2

Ensure, that the redirect built in #2 keeps all the request parameters from the original link in email. Hence you will maintain e.g. utm parameters all the way to your final destination. You can use e.g. http://www.apachemobilefilter.org/ as a basis for detecting and redirecting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.