Skip to main content

Google Tag Manager

Deploy edrone tracking using Google Tag Manager for easier management.

Benefits

  • Centralized management - all tags in one place
  • No code changes - deploy without developer help
  • Version control - rollback if needed
  • Testing - preview before publishing

Setup

1. Create edrone initialization tag

  1. Go to GTM → Tags → New
  2. Choose Custom HTML
  3. Paste the initialization code:
<script type="text/javascript">
(function (appId) {
window._edrone = window._edrone || {};
_edrone.app_id = appId;
_edrone.platform = 'custom';
var doc = document.createElement('script');
doc.type = 'text/javascript';
doc.async = true;
doc.src = "https://d3bo67muzbfgtl.cloudfront.net/edrone_2_0.js?app_id=" + appId;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(doc, s);
})("YOUR_APP_ID");
</script>
  1. Set trigger: All Pages
  2. Save and name it "edrone - Initialization"

2. Create event tags

For each event type, create a Custom HTML tag:

Product View tag

<script type="text/javascript">
window._edrone = window._edrone || {};
_edrone.action_type = 'product_view';
_edrone.product_ids = '{{Product ID}}';
_edrone.product_titles = '{{Product Title}}';
_edrone.product_images = '{{Product Image}}';
_edrone.product_urls = '{{Product URL}}';
_edrone.product_category_ids = '{{Category IDs}}';
_edrone.product_category_names = '{{Category Names}}';
</script>

Trigger: Page View - Product pages only

3. Create Data Layer variables

Create GTM variables for product data:

Variable NameData Layer Variable
Product IDecommerce.detail.products.0.id
Product Titleecommerce.detail.products.0.name
Product Imageecommerce.detail.products.0.image
Product URLecommerce.detail.products.0.url

4. Push data to Data Layer

On your website, push product data:

dataLayer.push({
ecommerce: {
detail: {
products: [{
id: '12345',
name: 'Nike Air Max 90',
image: 'https://store.com/img.jpg',
url: 'https://store.com/product/nike',
category: 'Shoes/Sneakers/Nike'
}]
}
}
});

Testing

  1. Click Preview in GTM
  2. Visit your store
  3. Check that tags fire correctly
  4. Verify requests to api.edrone.me in browser DevTools

Publishing

After testing:

  1. Click Submit in GTM
  2. Add version name and notes
  3. Click Publish