Jump to content


Photo

URGENT: Incorrect tracking link.

marketing tracking link webtracker staff response

  • Please log in to reply
7 replies to this topic

#1 shankar

shankar

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 31 January 2017 - 02:23 AM

Hi,

 

I just sent out a marketing campaign - while there were a number of opens reported, not a single click was reported.

 

In investigating, I looked at an email that was returned as undeliverable for the tracking links.

 

Clicking on the links in that email gave me a 404 Error with the message :

 

Error 404
The system is unable to find the requested action "click". 

You have made an invalid request, please do not repeat this.

 

It appears the link in the email was going to /index.php/api ...

http://crm.exaget.co.../www.exaget.com

which results in a 404 Error.

 

I checked against the test mail which I had initially sent and the tracking link in that email was quite different (and works well) (goes to index.php/marketing

http://crm.exaget.co.../www.exaget.com

 

That not only explains why none of the clicks were recorded, but worse the links themselves don't work.

 

Two questions :

1) why did the tracking link change between the test email and the actual launch

2) Is there anything I can do as an interim measure (redirect api to marketing) for some people who may still open the email a day late ?

 

Shankar

 

PS : I now added a http redirect from index.php/api to index.php/marketing, which seems to be working. But the original issue of the wrong link in the email remains. So will appreciate a guidance for the future.


Edited by shankar, 31 January 2017 - 03:25 AM.


#2 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 865 posts
  • LocationSanta Cruz, CA

Posted 31 January 2017 - 11:31 AM

Hello Shankar,

 

I have just performed some testing and can confirm that the bug is present in base code. I've already patched this internally for the upcoming point release, but if you would like to patch your instance, the changes are minuscule. Update the file protected/modules/marketing/components/CampaignMailingBehavior.php in the method prepareEmail(), updating the code to specify the full path to the action, '/marketing/marketing/click' instead of just 'click'.

        if ($campaign->enableRedirectLinks) {

            // Replace links with tracking links
            $url = Yii::app()->controller->createAbsoluteUrl (
                '/marketing/marketing/click', array ('uid' => $uniqueId, 'type' => 'click'));

The reason that some links used the correct 'marketing' controller is due to the context of when each email is sent. Without the full path to the MarketingController.actionClick(), sending emails automatically via cron would incorrectly resolve the 'click' action as being from the ApiController. When emails were sent from within the web application, the current module would be the marketing module, and hence the action would resolve correctly.

 

Thanks for reporting this issue!

 

Raymond



#3 shankar

shankar

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 31 January 2017 - 01:57 PM

Is it /marketing/marketing or just one marketing ? At least the url that works has only one marketing in it.

 

Also, I am currently redirecting all /api to /marketing, which works for those links and I'll have to leave that on for a few days.

 

Are there any other functions that may be affected because of that ?

 

Shankar



#4 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 865 posts
  • LocationSanta Cruz, CA

Posted 31 January 2017 - 03:07 PM

That's correct, you'll want two "marketing" strings used in the path. This isn't a direct URI, it's used by Yii to construct the URL. The first string is for the module, the second is for the controller, and the third is the action.

 

Based on the location of this issue, it should be contained to sending campaign emails. You'll be safe to keep the redirect for a few days to collect each of your visitor's activity, and shouldn't see any impact if you're not using the legacy API. The legacy API is mostly used for it's actionVoip() now anyway, so if you're not using that you'll likely have no issues.

 

Raymond



#5 shankar

shankar

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 01 February 2017 - 03:46 AM

I seem to have lost the web activity tracking now. I don't seen any anonymous tracking since I made the change above.

 
 

 

Also, I see the following error in the console

http://crm.exaget.co...fonts=801876595Failed to load resource: the server responded with a status of 404 (Not Found)

 

Pasting the URL in my browser gives me :

 

 

 

Error 404

The system is unable to find the requested action "webListener". 

You have made an invalid request, please do not repeat this.



#6 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 865 posts
  • LocationSanta Cruz, CA

Posted 01 February 2017 - 04:17 PM

Ahhh yes, the webListener is unfortunately still served from that path... You'll want to add an exclusion to your redirect rule if the URI is api/webListener in this case, sorry about that.



#7 shankar

shankar

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 01 February 2017 - 11:21 PM

Ok. I changed from a Redirect to a Rewrite in my .htaccess, which gets rid of the problem.

 

For the benefit of anyone else who may need this in future, the Rewrite rule that I used is as follows:

RewriteRule ^index.php/api/click(.*)$ http://my.x2crm.doma...keting/click$1 [R=301,L]

 

Things seem to be working for now.



#8 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 865 posts
  • LocationSanta Cruz, CA

Posted 02 February 2017 - 10:02 AM

Excellent, that's great to hear, I'm glad this has alleviated your issues. Thanks again for reporting this bug!







Also tagged with one or more of these keywords: marketing, tracking link, webtracker, staff response

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users