Issue while fetching aem contexthub dataelement in DTM for triggering some alert event | Community
Skip to main content
Level 2
September 15, 2016
Solved

Issue while fetching aem contexthub dataelement in DTM for triggering some alert event

  • September 15, 2016
  • 13 replies
  • 6284 views

Hello Experts, I am new to DTM world and following dtm.pdf for implementing an event based rule which is triggered by the dataelement value change of aem contexthub data element. The step by step example is given in standard dtm.pdf at page# 52 onward.

Issue:

  1. As per the instructions, I've created a dataelement in DTM which is reading cart.totalPriceFloat contexthub variable. Another eventbased rule is monitoring the dataelementchanged action of this dataelement. All propety, AEMcontexthub tool, dataelement rule and event rules are activated properly. But on changing cart.totalPriceFloat from contexthub, DTM is not triggering the alert as per the rule. While if I check the variable value in contexthub using console command - ContextHub.getItem("/store/cart").totalPriceFloat; it is updating properly.
  2. I tried to setup a page load rule for showing some alert, it is working perfectly fine.
  3. Another issue I observed, my satellite library is not loading in browser. If I hit the below console command - _satellite.settings.notifications = true; it returns "VM7955:1 Uncaught ReferenceError: _satellite is not defined".
  4. I followed all steps to configure my header and footer based on stg values as mentioned in the article https://helpx.adobe.com/dtm/kb/why-do-i-see-satellite-is-not-defined-in-my-console.html but still it is not loading. I am not finding any keyword specific to satellite in the view source of my page.

 

I believe, issue mentioned in step#1 is related with issue mentioned in point# 3. Please provide any pointer to resolve the issue, it would be great help. Thanks - DJ

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ParitMittal

Hi  Deepak ,

Ideally "_satellite not defined"  is encountered only when the Header Code doesn't get properly loaded on the page or referenced at the incorrect location. Can you please share the URL of your Website as well as DTM account details in a private message so that we can debug the issue at our end.

Thanks & Regards

Parit Mittal

13 replies

kautuk_sahni
Community Manager
Community Manager
September 15, 2016

Hi 

I am moving this question to DTM forum.

There more DTM expert could help you in answering this question.

~kautuk

Kautuk Sahni
ParitMittal
ParitMittalAccepted solution
Level 10
September 16, 2016

Hi  Deepak ,

Ideally "_satellite not defined"  is encountered only when the Header Code doesn't get properly loaded on the page or referenced at the incorrect location. Can you please share the URL of your Website as well as DTM account details in a private message so that we can debug the issue at our end.

Thanks & Regards

Parit Mittal

Level 2
September 17, 2016

ParitMittal wrote...

Hi  Deepak ,

Ideally "_satellite not defined"  is encountered only when the Header Code doesn't get properly loaded on the page or referenced at the incorrect location. Can you please share the URL of your Website as well as DTM account details in a private message so that we can debug the issue at our end.

Thanks & Regards

Parit Mittal

 

Thanks Parit!

I am able to fix the "_satellite not defined" after setting up DTM embed header and footer in my AEM DTM couldservice configuration. That issue has been resolved now.

However, I am exploring the AEM ContextHub stores and how the store dataelements can trigger the DTM events. I am able to trigger a DTM event on dataelementchanged condition using default out of the box "commerce.cart" store. Now, I want to customize the store or want to create a new custom store with my own variable say "empid" and want to trigger same event. 

Could you please suggest/point -

  1. How I can create a custom store?
  2. How I can generate the JSON specific contexthub object for this store? 

It would be great help, thanks in advance!!

ParitMittal
Level 10
September 19, 2016

Hi  Deepak ,

Thanks for letting us know.  As per our understanding , You want to use AEM ContextHub tool that references and uses a custom, non-ContextHub data layer within the Dynamic Tag Management configuration. Please see the below link for information on creating non-ContextHub data layer 

https://marketing.adobe.com/resources/help/en_US/dtm/c_custom-data-layer-example.html

Thanks & Regards

Parit Mittal

Level 2
September 19, 2016

Thanks Parit for sharing the link, it is very helpful. Though, I am referencing the link but still facing some challenges while triggering the dataelementchanged event on my custom data element. Please check the attached word document to see the steps I am following.

 

Please suggest if I need to perform some step differently, it would be great help. Thanks!

 

"store.session-store.js" for reference - 

ContextHub.console.log(ContextHub.Shared.timestamp(), '[loading] contexthub.store.demo.01-session-store - store.session-store.js');

(function($) {
    'use strict';

    /* default config */
    var defaultConfig = {
        /* initial values to set in store's storage */
        initialValues: {
            name: 'Alison Parker',
            age: 22
        }
    };

    /**
     * Store implementation.
     *
     * @extends ContextHub.Store.SessionStore
     * @param {String} name - store name
     * @param {Object} config - config
     * @constructor
     */
    var TestStore = function(name, config) {
        this.config = $.extend(true, {}, defaultConfig, config);
        this.init(name, this.config);
    };

    /* inherit from ContextHub.Store.SessionStore */
    ContextHub.Utils.inheritance.inherit(TestStore, ContextHub.Store.SessionStore);

    /**
     * Returns name.
     *
     * @return {String}
     */
    TestStore.prototype.getName = function() {
        return this.getItem('name') || '[unknown]';
    };

    /**
     * Returns age.
     *
     * @return {Number}
     */
    TestStore.prototype.getAge = function() {
        return this.getItem('age') || '[unknown]';
    };

    /* register store candidate */
    ContextHub.Utils.storeCandidates.registerStoreCandidate(TestStore, 'demo.01-session-store', 0);

}(ContextHubJQ));

Level 2
September 20, 2016

ParitMittal wrote...

Hi  Deepak ,

Thanks for letting us know.  As per our understanding , You want to use AEM ContextHub tool that references and uses a custom, non-ContextHub data layer within the Dynamic Tag Management configuration. Please see the below link for information on creating non-ContextHub data layer 

https://marketing.adobe.com/resources/help/en_US/dtm/c_custom-data-layer-example.html

Thanks & Regards

Parit Mittal

 

Hi Parit, Please suggest, waiting for your response on my below post. Thanks!

ParitMittal
Level 10
September 20, 2016

Hi Deepak ,

We are looking into your query and will get back to you ASAP.

Thanks & Regards

Parit Mittal

Level 2
September 20, 2016

Thanks Parit, I know you'll definitely provide some solution. Just requesting, please go through the attached word document and "store.session-store.js" that will provide more insight. Thanks in advance!

ParitMittal
Level 10
September 20, 2016

Hi Deepak,

If the custom data layer is a modification of the ContextHub schema be sure to add “ContextHub” in the Data Layer Root field.

Also, The schema you are providing is incorrect . The schema for your  data layer will be like :

{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "01-session-store": { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "number" } }, "required": ["name","age"] } } }

Rest of the things are good to go. I hope issues will be resolved after making above changes.

Thanks & Regards

Parit Mittal

Level 2
September 20, 2016

Thanks Parit for quick help, let me follow the instructions. I'll get back to you with result. Thanks a lot!