Including article title in a URL parameter

Answered

7 Comments

  • Leah
    Zendesk Voice of Customer Team

    Hi there!

    The article object by default is only available on the on the article page. You can find more on that here.

    You can still access this data by going through the category and/ section object to get to the article object, depending on the page you're on. Which page is it that you're trying to add this property? 

     

    0
  • Deb Chatigny

    Hi Leah,

    Grant and I are creating a Google Forms survey, and want to include a link to the survey from help center article pages. When someone clicks the survey link from an article page, we'd like to auto-populate a field in the survey with the referral page URL and/or article title, so that we can correlate the feedback we receive to the help center article that generated it.

    We had this working when we were using a different doc tool, but are not sure how to replicate this behavior in the article_page.hbs template.

    @Wes - thoughts on how to accomplish this? 

    Thx!

    Deb

    0
  • Wes Drury

    @Deb - What template are tying to insert this on.  I did a quick test and what Grant had above worked for me when plugging it into the Article template.

    <p><a href="https://example.com/form/&parameter={{article.title}}">Click here</a></p>

     

    As you can see above it added the title "Getting Started fro Project Managers".

    0
  • Deb Chatigny

    @Wes, we want to add this to the article_page.hbs template only.

    Could it be because we're trying to use dynamic content? We want the article title to populate into either an English or Spanish survey, depending upon if the survey participant selects the link from an English or Spanish help center article. Here's what it will look like on the article page:

    Here's the code in the article_page.hbs, where we're using dynamic content for both 'Help us to improve our Help Center' and 'Send us your feedback':

    Here's the dynamic content survey code {{ dc 'send_us_your_feedback'}} :

    <p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform" rel="noopener">Send us your feedback</a></p>

     

    And in Spanish:

    <p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSeAa2VWYhYTw_-RmahWKDK1-yGHJVOwc3aL5K1yfwtw_-ES2g/viewform" rel="noopener">Envíanos tus comentarios</a></p>

    Thanks!

    Deb

     

     

    0
  • Trapta
    Community Moderator

    Hi @Deb Chatigny,

    That's right. You can create DC for text i.e. 'Send us your feedback' with English and Spanish variant. Then you can use it in a way as @wes suggested in the comment above.

    Let me know if you face any issue.

    Team Diziana

    0
  • Ggoodman

    This still isn't working for us. In our article template, we include this dynamic content:

    <p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform" rel="noopener">Send us your feedback</a></p>

    I added the &entry.241692674={{article.title}} query parameter to it:

    <p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform/&entry.241692674={{article.title}}" rel="noopener">Send us your feedback</a></p>

    The result is that the URL includes the literal article.title and not the value of article.title.

    https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform&entry.241692674=%7B%7Barticle.title%7D%7D

    Any thoughts?

    0
  • Trapta
    Community Moderator

    Hi @Ggoodman,

    Try creating DC for "Send us your feedback" text only and in your template code use:

    <p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform/&entry.241692674={{article.title}}" rel="noopener">USE_YOUR_DC_HERE</a></p>

    Let me know if you face any issue.

    Team Diziana

    0

Please sign in to leave a comment.

Powered by Zendesk