javascript-api icon indicating copy to clipboard operation
javascript-api copied to clipboard

Using _agile.set_email() doesn't seem to backtrack web visits

Open mbaxter91288 opened this issue 7 years ago • 2 comments

Hi there,

I use a PHP CMS called October CMS and I have created a form plugin. Upon a user submitting this form, I use the REST API to add a contact, and optionally add them to a campaign. This is all working perfectly.

I would like to track the user's previous web visits. Based on your documentation, it sounds like this should be possible.

Anonymous users are tracked and backtracked when a user email is added using set_email.

I validate the form with Parsely.js and listen for the submit event, then get all the inputs, find the email input and then use the agile set email function:

$.listen('parsley:form:submit', function(e) {
	var inputs = e.$element.serializeArray();
	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i]['name'] == 'email') {
			console.log(inputs[i]['value']);
			_agile.set_email(inputs[i]['value']);
		}
	}
});

This works as I then get a notification within Agile telling me the new user is viewing my page, however, it hasn't backed tracked their views. For example:

  • visit http://www.plugindemo.local/
  • visit http://www.plugindemo.local/about
  • visit http://www.plugindemo.local/test
  • visit http://www.plugindemo.local/
  • I then submit the form on the homepage
  • after form submission, I get redirected to the homepage

I look at the contact record in Agile and I only see 1 visit to the homepage.

It seems to then continue to track web visits as you'd expect, just doesn't do the backtracking.

Please advise.

Regards, Mat

mbaxter91288 avatar Apr 26 '17 18:04 mbaxter91288

Hi @mbaxter91288 ,

Could you please confirm you have kept Agile CRM analytics code at each side. If not you have to kept.

Now suppose at website C.HTML you have register contact to Agile CRM and here you are settings email (cookies)

So first time only at C.HTML page viewing will be shown. Then After any page (A.HTML, B.HTML or C.HTML) you visit it will show respective page browsing status.

Please share your video snapshot in case you need further information.

Thanks

graut avatar Apr 28 '17 11:04 graut

Hi @graut,

Thanks for getting back to me. Not sure I fully understand you response, however:

The Agile CRM tracking I can confirm is on all pages. For testing, I have a very simple page setup. I've cleared all cookies and refreshed the page and once page is loaded, I have the following cookies:

  • cv1daof0q1a36otjibaqf59lgf-agile-crm-guid
  • cv1daof0q1a36otjibaqf59lgf-agile-crm-session_id
  • cv1daof0q1a36otjibaqf59lgf-agile-crm-session_start_time

I then navigate to multiple pages, confirming the above cookies are still present. Once I return to the homepage, I submit my simple form, which, upon form.submit() calls the _agile.set_email function using the email passed in the form.

Once the page reloads, I now have the following cookie as well:

  • cv1daof0q1a36otjibaqf59lgf-agile-email

Then, logging into my Agile dashboard, I can see my new contact record and look into "Web Stats" and only see one visit to the homepage.

If I then navigate to the /about page, that continues to track successfully, however, still no previous web history.

Hope that helps.

Regards, Mat

mbaxter91288 avatar Apr 28 '17 11:04 mbaxter91288