function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
david_navigator_david_navigator_ 

Rating a lead from info in a custom object (Google Adwords)

I'd like to create a field which rates a lead 1 thru 10 depending upon certain criteria.

99% of our leads come from our web to salesforce form and therefore one of the criteria is the search term the lead used in Google to find us.

This is in a custom object called Search_Phrase which has a field called search phrase, created by the Adwords to SalesForce app.

Although theoretically there could be many search phrases per lead, practically there is only one.

 

I was hoping that I could do something with some clever custom fields, but it seems that it's just not possible and so I assume some Apex is required. Although I am a developer with over 20 years experience, I've never written anything using apex and so I'm not sure what I need to do and thus any help would be good.

As a start I just want to do something simple such as (in pseudo code)

 

if search_phrase.searchphrase contains "mysoftware" then rating = rating + 1;

if search_phrase.searchphrase contains "crack" then rating = rating - 10;

return rating;

 

Many thanks

 

David

jkucerajkucera

A Search_Phrase__c trigger should do the trick. 

 

I have a lead scoring app that lets you score based on lead fields or campaign member fields so to save you some work, this approach might be quickest:

1) Create a custom field on Lead called SearchPhrase__c

2) Create a trigger on Search_Phrase__c that copies the latest search phrase for the lead to the custom field on lead

3) Install the lead scoring package

http://sites.force.com/appexchange/listingDetail?listingId=a0N300000024tT3EAI

 

4) Create rules that score leads based on search phrase

 

The benefits of the app are that you can easily see & change criteria & scoring.  It will save you the work of exposing these yourself.

 

 

david_navigator_david_navigator_

Thanks, your lead scoring package looks just what I need, however I have hit a problem. Apparently as a professional SF subscriber I'm not allowed access to Apex, so can't create a trigger. 

[Rant time]

Why do SF think that only Enterprise sized organisations need to write custom code -  we might only be 5 users, but getting SF to work correctly for our organisation is as important as it is for an organisation with 500 users.

Don't they realise that small companies turn into big companies and if they help nuture them now, then that will create brand loyalty. ATM I have no loyalty to SF, I think it's lacking in several areas (which could easily be patched with some custom code) and there's nothing to stop me jumping ship when something else comes along (and something else will come along, it always does).

[Rant Over]

 

Any one any suggestions on how to get around this problem ?

jkucerajkucera

Ah-sorry about the PE issue.

 

In general, code from native managed packages can be installed in PE orgs.  You might be able to create a DE org, package the code, and install it.  If that doesn't work, you might be able to publish privately on the AppExchange and install from there.

david_navigator_david_navigator_

Thanks I'll take a look at the developer edition. Is it free or something else I have to buy ?

 

I am a bit annoyed with the Sales Rep who sold us SF. I explained to him that we were a software house and that we'd want to heavily customise SF and he told me (and sold me)  that we'd need API access. I'm assuming that this isn't the same as Apex access and that he's pulled a fast one as now looking at API access it looks like that's about integrating SF with the outside world, not changing the functionality ?

jkucerajkucera

DE orgs are free:

http://www.developerforce.com/events/regular/registration.php?d=70130000000EjHb

 

I'm actually not sure what purchasing API comes with - I'd ask him to clarify if API should include Apex & visualforce. 

 

In general most people using the API use it to have other systems get or push data to salesforce using code hosted outside salesforce, so it seems Apex wouldn't necessarily be included, though I can see why this would be frustrating.

david_navigator_david_navigator_

Many thanks. It seems that the rep who sold us the API is no longer with the company, but our new account manager tells me that Apex is not available even as an addon for professional users.

 

So it looks as if I need to do this as an app as you suggested. I've signed up for the developer version and just running through some tutorials, but I haven't found anything as yet that tells me how I would attach a trigger from my new object to an existing object (the google search terms). Is it possible and if so, what terminology should I be looking for in the tutorial ?

Or should I be approaching this in a different way ?

jkucerajkucera

You might want to search the developer boards for lead triggers with custom objects.

 

If you are having trouble, I recommend contracting a developer to help you out - it's a relatively straightforward trigger to copy something from a custom object to it's parent:

 

trigger aasd on SearchPhrase__c (before insert) {

//get all the lead id's from Trigger.new & search phrases

//query for leads

//Set the lead.SearchPhrase__c custom field that you create to the value in trigger.new

//update the leads outside the loop

}

david_navigator_david_navigator_

Many thanks, that's a point in the right direction. I am a very experienced database developer so contracting someone else goes against the grain, it's just SalesForce that I'm new to, so at the bottom of that specific learning curve.

 

[Actually thinking about it, I just realised that I first wrote some SQL for Oracle in about 1986]