Trying to get campaign tracking links sent through workflow emails (almost solved need some help)

Originally, my links look like this:
http://www.example.com/index.php?entryPoint=campaign_trackerv2&track=9d91ec8c-f599-f6d1-8b11-5f779ac30806&identifier=1bba0061-d95a-79aa-622e-5f779c0cb709

where &identifier= is some randomly generated string

Now, they look like this:
http://www.example.com/index.php?entryPoint=campaign_trackerv2&track=9d91ec8c-f599-f6d1-8b11-5f779ac30806&identifier=“id of person (lead being sent the email)”

To get the tracking link, I had to do the following:
1 - send test email from the campaign
2 - Copy the link from the email
3 - edit the email template that workflow sends to have a manually created link where &identifier is given a variable that I assigned the lead_id to.

That all works as expected. The campaign even shows the stats that the appropriate link was clicked and how many times that link was hit.

THE PROBLEM:
When the tracking shows the link was clicked, it ignores all of the unique identifiers and attributes the link clicks to the test target and adds hits each time the link is clicked from any lead. I noticed that the target_tracker_key was null in the database for the new entry.

I need advice on what piece of code I need to change to generate that tracking code. All help is greatly appreciated!

I find your issue interesting and I would like to help, but I don’t have time to go in-depth and try things out and get to the bottom of it.

I can try giving you some ideas and accompanying you along the way…

One thing I still don’t have clear in my head. There are two separate problems here:

  1. Producing the link: generating the correct URL to send out in the email
  2. Consuming the link: the user clicks the link in the email and SuiteCRM records this fact in the campaign trackers

Which of these two problems are we getting? Or both?

For example, if you carefully craft the link manually (leaving problem 1. aside for now), can you get the desired effect in problem 2?

I took a few days to do some other work and get a clear head before tackling this again. Here’s where things stand currently:

Problem #1 Producing The Link - This is still mostly a problem. In fact, I believe it is the root of the problem. I created a mostly manual process to produce the link. The link looks identical to a real automated link that would come from the campaign. The fundamental difference is in the database. There is a field called “target_tracker_key” that gets a null value with the links I made. The result is like Schrodinger’s cat. It both works and fails at the same time.

Problem #2 Consuming The Link - Again, I currently have it both working and failing at the same time. When a link is clicked, the correct campaign knows and correctly registers which link was clicked. (I’m using 3 different links in the same email for testing.) That part is a win. The problem however stems from the link generation. Instead of showing each new person that has clicked it, the system adds hits to the test user that I used to generate the link.

If I send the email through the campaign manually as the system is setup to do, it does show each user separated as they should be. This leads me to believe that consumption is NOT an actual problem but is in fact a symptom of problem #1. For now, let’s explore #1 as if there is no #2 as I feel that will correct itself.

How I produce the link:

Step 1 - Create the newsletter campaign.
Step 2 - Create the 3 target lists.
Step 3 - Create the test target and add to the primary non test target list.
Step 4 - Create the email template and tracking links.
Step 5 - Send the campaign email.
Step 6 - Copy the URL from the received email.
Step 7 - Create the Webform and add to website.
Step 8 - Create a workflow
Step 9 - The workflow needs to grab all new leads brought in by the form using the matching campaign field as the condition. Then it modifies the record to add the ID of the incoming lead to a specified field. In this case I used department. Finally, it send an email. In that action, I edit the template to have the copied url from step 6 with 1 exception. I remove the identifier and replace it with the department field variable.

By using the new lead ID as the identifier, I can make sure each lead gets a unique tracking link.

I’m sure you’ll agree that this method is crap and can be done much more efficiently.

In a better world, Here’s how this should go:
Step 1 - Create the campaign.
Step 2 - Create the workflow. In the workflow where the email template is made, I would like to have the create tracking links module that is currently in the campaign creation area and links should use id as the identifier.

I think this plan would require the least amount of modifying to the core code.

In a perfect world…

The webform should collect the lead and add it to the target list for the campaign the webform was made for. Then they should get the email from that campaign automatically without the need for all these crazy manual actions.

That’s of course not taking into account that campaigns should consist of a full email sequence and not just one. This software would be much more widely used if it flowed like the real crms out there. It’s got most of the features, just not in the right order.

Suppose you just forget the Campaigns concept. In SuiteCRM, it means “a one-time, outgoing only, mass sending of emails”, which doesn’t seem to be what you’re looking for.

Suppose you just use…

  1. Web to person form to create a contact or lead
  2. Possibly a Workflow catching that lead and creating a case for it
  3. Handling all the successive interactions through cases module

Have a look at AOP Portal (free add-on from SalesAgility) which gives customers access to an area where they can post replies in their own cases.

Do you think this might work?

I looked into the cases module but that wouldn’t work.

I need all of the campaign functions as a repeated outgoing email.

But you know that the Cases module is integrated with email module? You can have all that email back-and-forth with the clients all tracked from within the Case.

I don’t know which files you’ve already found, but there’s a bunch of tracker stuff going on here:

–> https://github.com/salesagility/SuiteCRM/blob/master/modules/Campaigns/WizardMarketing.php

If it’s not that, tell me exactly which screens you go to, what do you press, I think I can find the underlying code.

You can delete this thread. I’m going to go in a different direction. This is too much effort for something that should be simple.

Ok, I understand.

Good luck with your efforts and with your campaign!