Table of Contents
Finding the 'Logged-In' Site ElementBuilding the Custom TargetBuilding the Experience and Testing the TargetYou may want to offer promotions, creatives, or other custom content for your site visitors only after they log in. You can address this common use case a number of different ways. This use case creates a custom target for a particular on-page site element that indicates whether a visitor is currently logged in.
Finding the 'Logged-In' Site Element
For this use case, a client navigates to their site and logs in.
When a visitor is logged in, the site then displays a Log out button on every page.
Using Chrome's Developer tools, the client finds the selector for this button by right-clicking the button and then selecting Inspect.
The client determines the name of the element is customer_logout_link
and then copies it by right-clicking the code in the Element window of Developer tools, expanding Copy, and then selecting Copy selector.
Building the Custom Target
The client then uses the Log out button element ID to build a target in Target Builder. Since this element only appears when a customer logs in, the target can search for its existence on a page to determine that a customer is currently logged in.
Launch Target Builder. Click COMPONENTS in the top navigation bar of the Kibo Personalization platform, and then select Targets.
Click CREATE TARGET.
Log back into your site in the new window that Target Builder launches so that you can test the element selector. Next, in Target Builder click the HTML Element tab, and then click Element Content (text).
Use the element selector to select the Log out button, paste the element ID for customer_logout_link
into Element Selector if necessary, and then click the forward arrow.
On the Details tab, input Log out
into Element Content and leave the selector set to EQUALS so that the target only triggers when that exact text is present on the page.
Because this target should work on any page on your site, no conditions are necessary. Click the forward arrow.
Give the target a title, a description, and a subcategory, and then click CREATE & EXIT.
Building the Experience and Testing the Target
After creating the target, you can build an experience to ensure that it works properly.
Create a new experience. Click WHO and then click ADD TARGET.
Click Custom Targets.
Click the target that you created.
Click SAVE.
Because you want to test the target, you must limit who can see the experience. To solve that problem, add your IP address as an additional target. Once again click ADD TARGET and then click Location.
Click IP address.
Input your IP address into the appropriate field and then click SAVE.
Ensure that the connector logic between the two WHO targets is set to AND.
To test that this target works as expected, the experience in this use case includes an action to display a placeholder image below the site navigation bar.
You cannot test a custom target using Preview Mode, so you must activate the experience to test it. Click ACTIVATE.
If the use case target works correctly, the placeholder image appears right below the site's navigation bar if the test visitor is logged in.
Once the test visitor logs out, that placeholder image should no longer appear.
After you confirm that your target works as expected, you can use it in a live experience for all site traffic.