Support » Plugin: Brilliant Web-to-Lead for Salesforce » Capturing page URL using a hidden field

  • Resolved Adam Blythe

    (@adsleeblythe)


    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/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Nick Ciske

    (@nickciske)

    Thread Starter Adam Blythe

    (@adsleeblythe)

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

    I guess the php goes in my functions.php?

    Thanks again

    Plugin Author Nick Ciske

    (@nickciske)

    Yup.

    Or you can make a plugin using Pluginception.

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

    Thread Starter Adam Blythe

    (@adsleeblythe)

    Brilliant thanks!

    Thread Starter Adam Blythe

    (@adsleeblythe)

    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.

    Plugin Author Nick Ciske

    (@nickciske)

    Glad you got it working!

    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.

    Plugin Author Nick Ciske

    (@nickciske)

    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/

    Plugin Author Nick Ciske

    (@nickciske)

    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.

    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%?

    Plugin Author Nick Ciske

    (@nickciske)

    Leave it blank.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Capturing page URL using a hidden field’ is closed to new replies.