Target Audience by Shopify Login

Privy's audience targeting rules are a collection of conditions that allow you to target individuals with specific displays so that you can display the right message, to the right person, at the right time. This guide reviews how to leverage some custom JavaScript to show a display to individuals who are or are not logged in during their visit. 

Note: You must use a Classic Display in order to target users by Shopify login

Target logged-in visitors

To add a targeting condition that will only show the display to visitors who are logged into their Shopify account for your store: 

  • Navigate to the Convert > All Displays via the main navigation. 
  • Select or create a display and navigate to the Target step in the display builder.
  • Select the Who To Show It To section and then the Add targeting condition button. 
  • Select the Custom JavaScript option from the Property dropdown menu. 
  • Paste the code listed below into the Value field. 
if (window.__st) {

return (__st.cid != null); 

}

return false;
  • Click the Save button to lock in your new targeting conditions. 

That's it! Your display will now only include visitors who are logged into their store accounts.

Target logged-out visitors

To add a targeting condition that will only show the display to visitors who are logged out of their Shopify account for your store: 

  • Navigate to the Convert > All Displays via the main navigation. 
  • Select or create a display and navigate to the Target step in the display builder.
  • Select the Who To Show It To section and then the Add targeting condition button. 
  • Select the Custom JavaScript option from the Property dropdown menu. 
  • Paste the code listed below into the Value field. 
if (window.__st) {

return (__st.cid == null);

}

return true;
  • Click the Save button to lock in your new targeting conditions. 

That's it! Your display will now only include visitors who are logged out of their store accounts.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us