How to add the tracking JavaScript code to my website?

Keep the following information in mind when you’re installing the Javascript snippet:

  • You copy the Javascript snippet in your GetResponse account. The snippet is always available for copying when you select Properties of the Purchase, Abandoned cart, and Visited URL conditions, under the Javascript code option.
  • You need administrative rights to be able to access your page source code.
  • Make sure to insert the snippet into each page where you’d like to track visitors.
  • Add the snippet directly into the HTML source code. If you’re using a site engine, insert the code into your website’s management system.
  • (Optional) Use the GrTracking method to properly identify your visitors who haven’t come to your website via a GetResponse message link. It requires passing on a user email as a parameter to GetResponse.

Where do I get the JavaScript code snippet?

1. Go to Automation >> Create workflow. Choose a condition to start building a workflow.
2. Drag and drop the ecommerce element you want to use into the workspace.
3. Click on the ecommerce element, and select JavaScript Code under Select integration Method
4. Click Get Web Connect

Now you need to you add the snippet to your website’s management system or insert it directly into the HTML source code.

Where do I insert the JavaScript code snippet?

If you can edit your HTML source directly, you simply copy/paste the JavaScript code into the page code.

JavaScript code snippet in a page.

Note: Our snippet needs to be the last element in the the section. Don’t put any tags between the closing tag of our snippet and the closing tag.

If you’re using a site engine, refer to your site engine documentation on how to add JavaScript code to pages.

Do I need to add the JavaScript code multiple times for different workflows?

You don’t have to add the JavaScript code snippet multiple times for your site each time you create a new workflow. Once you post the code on your site the first time, it will continue to track all future workflows.

When do I need to use the “GrTracking” method?

The GrTracking method is a way to properly identify your visitors who haven’t come to your website via a GetResponse message link. It requires a visitor email to be passed on to GetResponse as a parameter.

GrTracking allows you to set a list token. If you have the same subscriber on several lists, the list token will let you search for a subscriber on a particular list. For example, GrTracking(‘setListToken’, ‘<token>’). The list token needs to be placed before the email address.

You can find the list token in the list settings in your GetResponse account.

If you direct people to your pages using message links in your newsletters, the JavaScript code snippet you pasted into your page source code identifies them automatically.

If your visitors come from other websites where they leave their email address—for example, form submission pages, newsletter sign-ups, registrations, logins, purchase page details, etc.— you need to:

1. Add the JavaScript code snippet to your website where you’d like to track visitors (to get it, follow the steps we describe in “How do I get the JavaCode snippet”).
2. Add additional JavaScript code to pages where your customers leave their emails.

For example, for PHP-generated pages add

<?php echo ” GrTracking(‘ “.$userEmail. ” ‘); “; ?>

3. Make sure that appropriate forms pass the user’s email address in the $userEmail parameter (for PHP-generated pages). This means that you need to write additional lines of code that pass a customer email address as a $userEmail parameter. Note: This step requires advanced coding skills. Consider sending the code to your webmaster.

We’ll be adding more coding examples, so stay tuned.