Target Personalisation for return users based on last page visited. | Community
Skip to main content
Level 2
August 17, 2023
Solved

Target Personalisation for return users based on last page visited.

  • August 17, 2023
  • 1 reply
  • 1232 views

Hi all, 

 

I am looking for some help on a campaign I am looking to set up. We want to be able to change the content in the hero banner of our homepage for returning users based on the previous URL set they last viewed. 

 

For example it is their second visit and the last page they viewed was a product page for pets. I want to now show them a specific message relating to pets on our home page. 

 

Setting up the content I am comfortable with but its the targeting and audience setup that confuses me. 

 

I know that I will need to use the returningVisitor under visitor profile in the create and audience section. My question is what do I combine it with? Another question is what activity type would I use in target, would it still be an a/b test?

My understanding is that this would be personalisation?

 

For example we may have 5 pages relating to pets so how can I target users that were previously on these pages?

 

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rajneesh_Gautam_

Hi @thomasha  - the way to achieve your use-case is profile-scripts. You can capture the URL of the previous page in a profile-script as an example below. Given your use-case, you may extend the code to capture the 'last-page-category' if the page-category is passed as an mbox-parameter OR you can do some string-checks.

if (page.url != "") return page.url

 

if (page.url != "") { var url = "" + page.url.toLowerCase(); if (url.indexOf("pets") >-1) return "pets"; else if(url.indexOf("dogs") >-1) return "dogs"; else if(url.indexOf("cats") >-1) return "cats"; }

 

Refer to https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/variables-profiles-parameters-methods.html for more ways of creating profile-scripts

Afterwards, your can use the profile-parameters created by your profile-scripts to create Audiences. 

 

Let me know if you have any further queries

 

Regards

Rajneesh

1 reply

Rajneesh_Gautam_
Community Advisor
Rajneesh_Gautam_Community AdvisorAccepted solution
Community Advisor
August 21, 2023

Hi @thomasha  - the way to achieve your use-case is profile-scripts. You can capture the URL of the previous page in a profile-script as an example below. Given your use-case, you may extend the code to capture the 'last-page-category' if the page-category is passed as an mbox-parameter OR you can do some string-checks.

if (page.url != "") return page.url

 

if (page.url != "") { var url = "" + page.url.toLowerCase(); if (url.indexOf("pets") >-1) return "pets"; else if(url.indexOf("dogs") >-1) return "dogs"; else if(url.indexOf("cats") >-1) return "cats"; }

 

Refer to https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/variables-profiles-parameters-methods.html for more ways of creating profile-scripts

Afterwards, your can use the profile-parameters created by your profile-scripts to create Audiences. 

 

Let me know if you have any further queries

 

Regards

Rajneesh