How can I add a property to a URL to customize it for a visitor?

I am trying to use a "property" (i.e., a data field) from visitors in a hyperlink embedded in a Guide. Suppose the hyperlink is "https://nothinglink.com/cgi-bin?visitor={{visitor_id}}," such that 

Visitor abc12345

will see a Guide that has hyperlinked text, "Take our survey!", where the resulting hyperlink will be https://nothinglink.com/cgi-bin?visitor=abc12345.

I found this article on Guide Personalization, but it appears to only refer to mobile guides (I need to design this for desktop). I've attempted to use the curly braces as above, but when testing the implementation in .dev the resulting URL just has {{visitor_id}} in it, not a visitor_id associated with me.

  1. How can I achieve the desired effect? 
  2. Am I doing the correct thing and the desired effect is simply not viewable in .dev?
0

コメント

7件のコメント
  • I don't believe you can do it with OOTB functionality, but you should be able to add a custom code block to your guide step, then use javascript to note the visitor ID, find your button link, append the visitor ID to a URL, then replace the URL on your button with the appended one.

    I'm curious why you want the visitor ID on it though, if in Pendo you can see who clicked the link when -- unless your survey form is anonymous and you want to track who it is anyway?

    0
  • Liz Feller, yes that is exactly it. I am using external survey software. The survey will be collecting data both from users of our web application and respondents coming from an outside panel. For those coming from our application, I want to be able to segment their responses based on their attributes housed in our CRM without having to ask all those questions of them in the survey itself. 

    Do you know of a Pendo resource that I can use as a guide for the process you're describing? 

    0
  • in my experience, starting with an internal resource or learning some javascript is easiest. Check your work using jshint.com, and sometimes chatgpt or copilot are great tools to get you started :)

    0
  • Liz Feller just a heads up that I still haven't been able to resolve this problem. In-guide Javascript simply does not successfully generate an identifier. 

    0
  • It would probably be something like this, where you'd need to update your selector from the class I put in there as a placeholder.

    (function linkchange() {
    var pendolink = document.querySelector("._pendo-text-link");
    var visitorId = pendo.visitorId;
    const newlink = pendolink + '?visitor=' + visitorId;
    if (!pendo.designerEnabled) {
    link.setAttribute("href", newlink);
    }
    }
        )
    ();

    0
  • Liz Feller, thanks for the effort, but the Javascript code doesn't seem to be the issue. I was able to work with an Engineering partner to build code to do the task. The issue is that the page load on our site triggers multiple meta events and the visitor metadata is locked in from the first of those. Nothing we put into the Guide Javascript area seems to be able to update the visitor metadata. 

    0
  • well darn! Glad you found a solution though. I guess my only last idea would be to make pendo.initialize wait until all of the events on page load are done :) but seems like you're all set!

    0

サインインしてコメントを残してください。

お探しのものを見つけられませんでしたか?

新規投稿