WordPress.org

Forums

WordPress-to-lead for Salesforce CRM
[resolved] Capturing page URL using a hidden field (12 posts)

  1. Adam Blythe
    Member
    Posted 8 months ago #

    HI,

    I would like to know how I could capture the URL of the page my WordPress-to-lead form is on using a hidden field?

    I am aware that you can use %URL% in Lead Source field but it only has a maximum of 40 characters! Not good when your URLs are longer than that! Plus, we have the same form across multiple pages.

    We want to track where people are coming from e.g a LinkedIn campaign.

    Thanks

    https://wordpress.org/plugins/salesforce-wordpress-to-lead/

  2. Nick Ciske
    Member
    Plugin Author

    Posted 8 months ago #

  3. Adam Blythe
    Member
    Posted 8 months ago #

    Thank you Nick! I will give this a try ASAP.

    I guess the php goes in my functions.php?

    Thanks again

  4. Nick Ciske
    Member
    Plugin Author

    Posted 8 months ago #

    Yup.

    Or you can make a plugin using Pluginception.

    https://wordpress.org/plugins/pluginception/

  5. Adam Blythe
    Member
    Posted 8 months ago #

    Brilliant thanks!

  6. Adam Blythe
    Member
    Posted 7 months ago #

    Hi Nick,

    I have actually just this implemented your code...it works great thanks!

    There was just one problem that I had to fix though, the API name didn't work for me.

    I had to use a combination of numbers and letters associated with the custom field that you get when you generate a web-to-lead form under SalesForce - Setup - App Setup - Customise - Leads - Web-to-Lead e.g. '00ND0000005e0pN'

    Hope this makes sense!

    Thanks again.

  7. Nick Ciske
    Member
    Plugin Author

    Posted 7 months ago #

    Glad you got it working!

  8. dma132
    Member
    Posted 2 months ago #

    Hello,

    I used Pluginception to create this plugin based on the code from https://gist.github.com/nciske/10047552. When I try to activate it, I get this error:

    Fatal error: Cannot redeclare salesforce_w2l_field_embedurl() in /home/wp_5rdrm6/controlbionics.com/wp-content/plugins/salesforce-web-to-case-filter-for-urls/salesforce-web-to-case-filter-for-urls.php on line 26

    Any suggestions as to what might be wrong? I'm a bit out of my depth here but would like to store the URL of the form in a custom field in Salesforce.

    Thanks.

  9. Nick Ciske
    Member
    Plugin Author

    Posted 2 months ago #

    You need to rename the function with a prefix to match your site. The examples are just examples, they are not designed to be used verbatim. ;-)

    I'll try to clarify that in the documentation.

    So just replace salesforce_ with controlbionics_ in the function declaration and the filter callback (the second argument), but not the filter name (the first argument).

    http://nacin.com/2010/05/11/in-wordpress-prefix-everything/

  10. Nick Ciske
    Member
    Plugin Author

    Posted 2 months ago #

    Also check to make sure you don't have this defined elsewhere like functions.php - the error means your trying to declare this exact function name twice.

  11. dma132
    Member
    Posted 2 months ago #

    Thanks so much - that validated. One other question: when I add the custom field to my form, what should I enter in the Value field? %URL%?

  12. Nick Ciske
    Member
    Plugin Author

    Posted 2 months ago #

    Leave it blank.

Reply

You must log in to post.

About this Plugin

  • WordPress-to-lead for Salesforce CRM
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.