24/7 Support: 800.608.6482

Get Started

Developer Docs

1. Generate Conversion Tracking Code in Adwords

2. Adding Tracking Scripts to Miva

3. Assigning Scripts to a Resource Group

4. Import Tracking Scripts Configuration

How to Setup Google Adwords Conversion Tracking in Miva Merchant

Prerequisites: This tutorial assumes you’re on the latest version of Miva (or at least on version 9.0007 which introduces the JavaScript Asset Manager used in this tutorial.)

  1. Generate your Conversion Tracking code in Google Adwords

Here is a article describing how to generate your tracking code in Adwords:



There are two tracking codes generated. The first one is a global site wide script which needs to appear on every Miva page.

The global site tag adds visitors to your basic remarketing lists and sets new cookies on your domain, which will store information about the ad click that brought a user to your website. You must install this tag on every page of your website.

Here is an example of the global tracking script:

The second script is the Conversion Even script which needs to go on the page customers are taken to after they make a purchase. In Miva this is the INVC (Invoice) page.

This code needs to come right after the script above but only on the INVC page in Miva.

Adding Tracking Scripts to Miva

Now that we have our tracking scripts we can add them to our JavaScript Asset Manager in Miva and tell Miva where to output the code.

In Miva, go to User Interface -> JavaScript Resources


For the global script we’re actually going to split it into two pieces since the first line is loading an external script and the subsequent lines are initializing the code.

Click add to create a new JavaScript Resource:

Create a code for the resource such as “adwords.”

Make sure the type is set to External File and put in the the path found in the script.


Click Save.

Next we want to add the "async parameter" to the tag.

Select the record and hit “Edit Attributes” Here we want to delete the type attribute as its redundant and add the async attribute.


Because we want this script to load on all pages keep the global flag checked.

Global Flag Checked

For the second part of the Global Script we want to create an inline script. With inline scripts the opening and closing script tags are automatically output so we want to exclude them.

Click "Add" to create a new JavaScript Resource:

Create a code for the resource such as “adwords_global.”

Make sure the type is set to Inline Script. Once created, select the record and hit Edit Source.

Add your JavaScript code without the script tags.


Finally lets add the conversion tracking code which goes on the INVC page. Repeat the same steps as above.

Click "Add" to create a new JavaScript Resource:

Create a code for the resource such as “adwords_conversion.”

Make sure the type is set to Inline Script. Once created, select the record and hit "Edit Source."

Copy in the Javascript without the <script> tags.


Limiting the conversion tracking code to only INVC.

Because we only want the conversion tracking code on the INVC page, after it has been added, un-toggle the global flag.


With the Global flag turned off a new button for “Pages” will appear. Here we can choose which page we want the script to show up on:


Assign Script to a Resource Group

Now that we have have all our JavaScript code added and we have the global and page specific settings set we need to tell Miva where to output it to the page. This is done via Resource Groups.

Resource Groups tell Miva where you want your script to output on the page. There are two default groups, although new groups can be created.

Click the "Resource Groups Tab."


Since we want our code to show up in the head of the page choose head_tag and then click the "JavaScript Resources" Button. From here, toggle “Assigned” for all three JavaScript resources.


That’s it!

To verify it is working visit any page and view the source. You’ll see the following:

Note: Miva automatically adds the two data elements for data-resource-group and data-resource-code. These have no impact on the code itself and are only used to identify the resource code and Resource Group.

To verify the conversion tracking code is working correctly we can use Miva’s Token list to preview the Invoice page, and view the source to see the conversion tracking code:

Importing Tracking Script Configuration

Finally, this entire process can be automated using Miva’s XML import. By uploading a single XML file you can create the scripts, assign then to the right pages and resource groups. All you would need to do after importing the file is swap out your unique Adwords tracking code.

Here is a link to a file which can be imported under Data Management -> Import Data and Settings in XML Provisioning Format.

Miva believes that all online businesses should have access to a scalable ecommerce platform that can meet their unique business requirements. Miva offers PCI compliant ecommerce, hosting, and custom website design and development solutions. Miva customers have processed over $100 billion in online sales since 1997.

Copyright © 2016 Miva, Inc - All Rights Reserved   Privacy Policy | Store Policy

Contact Us
Receive Tips & Updates

Copyright © 2017 Miva, Inc - All Rights Reserved

Back To The Top